LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how to open exe on panel / canvas

Hi
 
Is there any way i can able to open vendor application program on our labwindows panel/canvas.
 
In my application vendor have xyz.exe which will create text file during the run and i want to run my application to open tht text file and take useful reading.  So in UI I want to put two buttons when they click first it will open vendor's exe file on my application /panel and once i done to run appication i will click second button to run text file parser.
 
Can you please send me some sample code to open xyz.exe file on labwindows panel.
 
Thanks
 
0 Kudos
Message 1 of 6
(4,092 Views)
To run an external program you can use System () or LaunchExecutable () function depending on wether you want you application to stop until the launched app is gone or you want to return immediately to your application. LaunchExecutableEx () function has some option more to determine how the launched app is run.

Message Edited by Roberto Bozzolo on 10-01-2005 02:33 PM



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 6
(4,087 Views)

One more question. I am getting handler but how can i able to find that application free that handler. Means I don't want to run my second application without exiting my first application. Can you please guide me.

Thanks

 

0 Kudos
Message 3 of 6
(4,060 Views)
Hello Vector,
 
You should then use the system() function which waits for the launched executable to finish before returning to the original application.  On the other hand, if the executable you are running take a long time to return, the CVI user interface is not going to get any updates.  As a result, you're going to see a decrease in responsiveness on your user interface.  As an alternative, you could use the LaunchExecutableEx function which returns a handle to the launched executable.  Then in a while loop, you can check if the launched executable has completed with the ExecutableHasTerminated function, then add a call to ProcessSystemEvents in the while loop in order to keep the user interface responsive.
 
done = 0;
LaunchExecutableEx(...,exehandle);
while (!done) {
    done = ExecutableHasTerminated(exehandle);
    ProcessSystemEvents();
}
 
 
On the user interface side, you can programmatically dim the second button before you call system/LaunchExecutableEx in the first button's callback function then re-enable the second button after the system/LaunchExecutableEx function has completed.  You can use the SetCtrlAttribute function with the ATTR_DIMMED attribute to do this.
 
Thanks
Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 4 of 6
(4,053 Views)

Hello Vetor,

 Did you get solution?

0 Kudos
Message 5 of 6
(2,745 Views)

@neha14cse  ha scritto:

Hello Vetor,

 Did you get solution?


Hello, reviving a 15-years-old discussion started from a user that has not connected since 2006 won't get you anywhere!

It would be better to start a new discussion adding some detail more on your actual problem, supposing the suggestion of calling System or LaunchExecutable given here is not what you need.



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 6 of 6
(2,731 Views)