
CreateProcess() sometimes fails to start QuickWin application
I have a 32-bit application which must start a 16-bit QuickWin
application on Windows 3.1x with Win32s 1.30. Sometimes it works just
fine. Other times, CreateProcess() fails and GetLastError() returns 0.
Can anyone explain what error 0 is?
It seems to work just fine if I don't log in to the Novell network.
However, if do log in to the network, but pass shorter parameters to the
QuickWin application the first time, I can get it to work the second
time with the correct parameters.
One other interesting item which MIGHT be related. The 32-bit
application is an SDI which puts up an initial dialog in the app's
InitInstance() before creating/adding the document template. If this
app is run from an icon in Program Manager, Program Manager "locks up"
until the dialog is dismissed. The same thing happens with File Manager
if this 32-bit app is started from F.M.
ANY insight or ideas will be GREATLY appreciated.
Thanks.
Jerry Koedam
Computer Data Systems, Inc.
The 32-bit application's code which starts the 16-bit QuickWin app is as
follows:
// call dologin.exe with appropriate parameters
// foramt is: 'login' 'password' DatabaseServerName
ReturnInfoFileName
CString strCommandLine;
strCommandLine = "dologin '";
strCommandLine += G_strLoginName + "' '";
strCommandLine += G_strPassword + "' ";
strCommandLine += strServerName + " ";
strCommandLine += strServerFileName;
BOOL bReturn; // return value from CreateProcess()
PROCESS_INFORMATION zProcessInformation; // param to CreateProcess()
STARTUPINFO zStartupInfo; // param to CreateProcess()
memset((void*)&zStartupInfo,'\0',sizeof(zStartupInfo));
zStartupInfo.cb = sizeof(zStartupInfo);
zStartupInfo.wShowWindow = SW_MINIMIZE;
zStartupInfo.dwFlags = STARTF_USESHOWWINDOW;
bReturn = CreateProcess(NULL,strCommandLine.GetBuffer(0),NULL,NULL,
FALSE,0,GetEnvironmentStrings(),NULL,&zStartupInfo,&zProcessInformation);
if (bReturn != TRUE)
{
int iErrorCode = GetLastError();
char szMessage[128];
sprintf(szMessage,"Could not run login program. (Error
%d)",iErrorCode);
AfxMessageBox(szMessage);
}