I can't use GECP. Firstly, I realise I must do the check BEFORE the closing of the handle. But I tried reading two files, one of which causes regedit to show a error message and for both files, the process exit code was 0. :(
> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Truckle, Andrew J > Sent: 21 October 2005 14:36 > To: '[email protected]' > Subject: Re: [msvc] Importing registry > > > > Hi Ehsan > > > > > Can't you use GetExitCodeProcess( ) to check the process > return code > > > for regedit.exe? > > > > This is how I do it: > > > > ShellExecuteEx( &se ); > > > > // wait for process to finish > > if( se.hProcess ) > > { > > WaitForSingleObject( se.hProcess, INFINITE ); > ---> GetExitCodeProcess(se.hProcess, &dwExitCode); > > Must I do it here, BEFORE I close the handle? Or can I do it > afterwards? > > > CloseHandle( se.hProcess ); > > } > > > > if( (DWORD)(se.hInstApp) < 33 ) > > { > > // Thow error > > AfxThrowUserException(); > > bImported = FALSE; > > } > > > > How would I modify this to use GetExitCodeProcess? > > > > Andrew > > > > > > This email and any attached files are confidential and > > copyright protected. If you are not the addressee, any > > dissemination of this communication is strictly prohibited. > > Unless otherwise expressly agreed in writing, nothing stated > > in this communication shall be legally binding. > > > > _______________________________________________ > > msvc mailing list > > [email protected] > > See > > http://beginthread.com/mailman/listinfo/msvc_beginthread.com > > for subscription changes, and list archive. > > > > > > This message has been scanned for viruses by MailControl - > > (see http://bluepages.wsatkins.co.uk/?4318150) > > > > _______________________________________________ > msvc mailing list > [email protected] > See > http://beginthread.com/mailman/listinfo/msvc_beginthread.com > for subscription changes, and list archive. > _______________________________________________ msvc mailing list [email protected] See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for subscription changes, and list archive.
