LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Waiting for windows idle

Hi,
I have a CVI application that fully works from a CVI generated EXE. However, I want this application to start each time I start my computer. Therefore, I copied a shortcut to the  EXE file to the windows startup folder. When I next run the computer the application starts but fails when calling a third party library associated with my application. If I run the the EXE file again (from the same startup location) the library call is successful and the application work correctly.
 
The third party library call is situated at the top of my code soon after the InitCVI command. If I use a 10 second delay (Delay(10)) between the InitCVI function call and the call to the third party library my application works every time. The problem seems to be that windows is still setting up when the call to the third party library occurs, and my third party library can not find enough system resources to open.
 
Although the 10 second delay works I would prefer to do this correctly. Is there a way I can wait for the windows system to fully setup (if that is what is causing this error). Or a way to wait until the windows system idles before calling my third party library init function?
 
Many thanks in advance for any help
 
Phil...
0 Kudos
Message 1 of 3
(3,113 Views)
I'm not aware of a method to know when windows has finished starting, but you could create a loop that periodically attempts the call to the third party library and exits only when successful. You will need to add a timeout to deal with the "definitely not ready" case.


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 2 of 3
(3,098 Views)

Hi Roberto,

Many thanks for this, that is a good idea - something I should have thought about (!)

Regards

 

Phil...

0 Kudos
Message 3 of 3
(3,089 Views)