Important alert: (current site time 5/21/2013 7:14:52 AM EDT)
 

winzip icon

Folder Watch

Email
Submitted on: 9/14/2006 9:10:16 AM
By: Rajneesh Noonia 
Level: Advanced
User Rating: Unrated
Compatibility: VB 3.0, VB 4.0 (16-bit), VB 4.0 (32-bit), VB 5.0, VB 6.0, VB Script
Views: 8238
author picture
(About the author)
 
     Folder Watch: In lot of application you need to look or wait for some file in folder or for some specific file. Normally developers use polling techniques to a poll folder or file with some frequency. But method is wastage of CPU resources and is not very real time. With FolderWatcher you can watch for events in particular folder or sub folders and take actions only when data is arrived. It uses ReadDirectoryChangesW function from Library kernel32 to monitor the changes in folder. This technique is call callback and is very efficient technique. Windows operating systems uses callback techniques almost every where (Off course whenever applicable) * Install utilities.dll and folderwatcher.dll and run folderwatchtest.vbp * You need Utilities.dll published on same site under Vb 6.0 with name “Advanced Utilities”

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 8 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
9/14/2006 9:33:40 AMPierre AOUN

You took the code of an example already on this site and it was much simpler: http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=61052&lngWId=1
(If this comment was disrespectful, please report it.)

 
9/14/2006 10:11:42 AMCobein

mmmmm It looks sooo familiar :S
(If this comment was disrespectful, please report it.)

 
9/16/2006 4:45:38 AMMPCole

Doesn't seem to work. Loop in Class makes the app instable.
(If this comment was disrespectful, please report it.)

 
9/18/2006 2:09:03 AMRajneesh Noonia

This code is tested and is working in production enviornment.You need to regsiter the dependencies (Utilities.dll) posted on same site.
(If this comment was disrespectful, please report it.)

 
10/24/2006 10:34:41 AMj-t

WHY HAVE YOU POSTED CODE THAT DOES NOT WORK OR IS INCOMPLETE. EITHER POST A COMPLETE WORKING VERSION OR DONT BOTHER NEXT TIME!!
(If this comment was disrespectful, please report it.)

 
2/11/2009 3:50:34 AMrafu

please provide all complete code.
(If this comment was disrespectful, please report it.)

 
2/13/2009 7:34:34 AMRajneesh Noonia

In the article i have mentioned that "You need Utilities.dll published on same site under Vb 6.0 with name “Advanced Utilities” "

The link for code is http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=66555&lngWId=1
Regards
Rajneesh

(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.