thanks - I figured that NULL would be ok... (Certainly would be if I wrote it...)

Oleg Khaschansky wrote:
Use this:

int main(int argc, char **argv, char **envp)
{
      PROCESS_INFORMATION procInfo;
      procInfo.dwProcessId = 0;
      procInfo.dwThreadId = 0;
      procInfo.hProcess = 0;
      procInfo.hThread = 0;

      STARTUPINFO sInfo;
      sInfo.cb = sizeof(STARTUPINFO);
      sInfo.lpReserved = NULL;
      sInfo.lpDesktop = NULL;
      sInfo.lpTitle = NULL;
      sInfo.dwFlags = 0;
      sInfo.cbReserved2 = 0;
      sInfo.lpReserved2 = NULL;

      CreateProcess("cmd.exe",NULL, NULL, NULL,

              FALSE, CREATE_NEW_CONSOLE, NULL, NULL, &sInfo,&procInfo);


}

On 12/4/06, Geir Magnusson Jr. <[EMAIL PROTECTED]> wrote:
I'm embarrassed to ask this, but it's been about 4 years since I did
windows programming in anger.  Why does the following simple console
win32 program *crash* :

#include <windows.h>

int main(int argc, char **argv, char **envp)
{
        PROCESS_INFORMATION procInfo;
        procInfo.dwProcessId = 0;
                procInfo.dwThreadId = 0;
         procInfo.hProcess = 0;
         procInfo.hThread = 0;

        CreateProcess("cmd.exe","", NULL, NULL,

                FALSE, 0, NULL, NULL, NULL,&procInfo);
}


I can understand why CreateProcess might *fail*, but I don't grok why it
would crash...

geir


Reply via email to