How to execute 16 bit process via CreateProcess
Hi Everyone,
I am unable to execute a 16 bit process from 32 bit process via CreateProcess. I am getting this error
'Error while setting up environment for the application. Choose Close to terminate the application.'
Here is my code
STARTUPINFO si;
memset( &si, 0, sizeof(STARTUPINFO) );
::GetStartupInfo( &si );
PROCESS_INFORMATION pi;
BOOL bRet = ::CreateProcess( NULL,
"C:\\ZTOOLS\\ZIMAGLIT.EXE Untitled.pcx Untitled.grf Untitled.GRF",
NULL,
NULL,
TRUE,
CREATE_NO_WINDOW|CREATE_SEPARATE_WOW_VDM,
::GetEnvironmentStrings(),
"C:\\ZTOOLS",
&si,
&pi );
Also here, I need to set the current directory to the one where the 16 bit process resides. In this case, I set it to "C:\Ztools".
I need to run the process through this function only because the process generates some files which I had to read when the process terminates. And only this function returns the new process handle which can be used to wait for its termination.
Thanks in advance.
Regards.
Re: How to execute 16 bit process via CreateProcess
What OS are you using? If it is Vista or later, you can say goodbye to 16 bit applications. They removed the 16 bit sub-system.
Re: How to execute 16 bit process via CreateProcess
Re: How to execute 16 bit process via CreateProcess
Does the following run from the command line?
Code:
C:\>C:\ZTOOLS\ZIMAGLIT.EXE Untitled.pcx Untitled.grf Untitled.GRF
If not, what are the errors?
Re: How to execute 16 bit process via CreateProcess