Link to home
Start Free TrialLog in
Avatar of soniasingh
soniasingh

asked on

calling C program from Visual basic and runnig both simultaneously

I need to invoke a C program from Visual basic.This C program does some calculations which takes approx. an hour and write  results in a file. What i need is to invoke this C Program from VB and then control should come back to Visual basic program so that processing is going at the end and C program is writing data in File and user is able to work on UI(Visual basic) as well.
Is it possible?
Avatar of Mohammed Nasman
Mohammed Nasman
Flag of Palestine, State of image

Hello

  Use CreateProcess API to lunch the C application, and use WaitForSingleObject API, to make your VB application wait till the lunched program finish, then the control will back to your VB applicationa will continue it's work

this is not the best option, maybe using Com Exe with Callback function will be better option, but I didn't tried that before

IF you don't want to wait for C program to finish, Just use Shell command to start your C program
ASKER CERTIFIED SOLUTION
Avatar of simon_thwaites
simon_thwaites

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial