![]() |
|
#1
|
|||
|
|||
Run an "exe" and wait till its closedHi Guys,,,
I'm working with an existing MFC application. I need to run a VB .NET application via this MFC application and wait till its closes.... I went thru several websites which suggested that I use ProcessStartInfo and run the VB.NET and wait for that... when I insert #using <system.dll> I'm getting CLR error "fatal error C1190: managed targeted code requires a '/clr' option" I'm not familiar with whats going on or how they developed the MFC application .All I know is that I ended up with lot of classes and I need to do minor changes... Is anyone outthere who could help me out with this? Is there any other way of running the VB .NET application via this MFC application? Thanks in advance,, Jana |
|
#2
|
|||
|
|||
Re: Run an "exe" and wait till its closedOh..I was so stupid...it was so easy....
http://forums.devx.com/showthread.php?threadid=159692 Here is the code which does the trick which was copied from the above link.... ############################# STARTUPINFO si = {0}; PROCESS_INFORMATION pi = {0}; ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory( &pi, sizeof(pi) ); TCHAR szCommandLine[] = _T("\"C:\\Windows\\system32\\calc.exe\""); if( !CreateProcess( NULL, szCommandLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ) ) { _tprintf( _T("CreateProcess failed - %d\n"), GetLastError() ); return; } WaitForSingleObject( pi.hProcess, INFINITE ); CloseHandle( pi.hProcess ); CloseHandle( pi.hThread ); ######################### cheers guys Jana |
Recent GIDBlog
Flickr uploads of IA pictures by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| wait() and waitpid() functions | groberts1980 | C Programming Language | 3 | 20-Sep-2006 17:57 |
| Java threads trouble (wait() and notify()) | smoothdogg00 | Java Forum | 3 | 08-Apr-2006 15:45 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The