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.