LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get status returned by the last process

Solved!
Go to solution

For a similar applicatin I made some attempt with some system function that may be of help in this case: FindFirstChangeNotification Win32 API function sets an event when some file in a folder is changed.

I am attaching a simple project that monitors a single file in a folder, receives notifications and if file is changed displays its content on screen. To test the example simply start the program, set the folder and file name and start monitoring: when you write in the file and save it, the program is notified and displays updated content in a textbox. There is no need to close the monitored file: simply save it (unless the file is opened in exclusive mode, in which case you are likely to get I/O errors).

 

The application works well for local files, while it gets errors while monitoring folders on a remote server and I didn't find a way to solve this.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 11 of 15
(1,387 Views)

Ah, having an event of course is much nicer!

0 Kudos
Message 12 of 15
(1,384 Views)

Much thanks, Roberto!

 

However, a couple compiling issues:

 

  1. The icon wasn't found (no big deal, I just removed the link)
  2. The two attached libraries (libhpdf.lib and Version.lib) were not included in the zip.
  3. The project doesn't have the INI file library attached (again, no big deal, I attached myself).

 

0 Kudos
Message 13 of 15
(1,374 Views)

I was in a hurry and didn't pay attention to those details. Anyway, neither the icon nor the libraries are needed to run the sample: this one is the reduction of a bigger test program I had that made use of them but I stripped out the relevant instructions. And I forgot to add the config file too... Smiley Surprised



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 14 of 15
(1,369 Views)

Wolfgang ha scritto:

Ah, having an event of course is much nicer!


I am coming to think that some kind of event does exist in Windows for almost every condition I can think of! Smiley Wink

 

The problems I have are:

  1. Knowing that an event handling function actually exists for some problem I may have
  2. Understanding how it may work (Windows APIs normally aren't so user friendly and deeping in the documentation can be a challenge sometimes!)


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 15 of 15
(1,365 Views)