title: CreateProcess doesn't pass command line arguments
body: <p>Hello I have the following code but it isn't working as expected, can't figure out what the problem is.</p>
  
  <p>Basically, I'm executing a process (a .NET process) and passing it command line arguments, it is executed successfully by CreateProcess() but CreateProcess() isn't passing the command line arguments</p>
  
  <p>What am I doing wrong here??</p>
  
  <pre><code>int main(int argc, char* argv[])
  {
      PROCESS_INFORMATION ProcessInfo; //This is what we get as an [out] parameter
  
      STARTUPINFO StartupInfo; //This is an [in] parameter
  
      ZeroMemory(&amp;StartupInfo, sizeof(StartupInfo));
      StartupInfo.cb = sizeof StartupInfo ; //Only compulsory field
  
      LPTSTR cmdArgs = "name@example.com";
  
      if(CreateProcess("D:\\email\\smtp.exe", cmdArgs, 
          NULL,NULL,FALSE,0,NULL,
          NULL,&amp;StartupInfo,&amp;ProcessInfo))
      { 
          WaitForSingleObject(ProcessInfo.hProcess,INFINITE);
          CloseHandle(ProcessInfo.hThread);
          CloseHandle(ProcessInfo.hProcess);
  
          printf("Yohoo!");
      }  
      else
      {
          printf("The process could not be started...");
      }
  
      return 0;
  }
  </code></pre>
  
  <p><strong>EDIT:</strong> Hey one more thing, if I pass my <code>cmdArgs</code> like this:</p>
  
  <pre><code>// a space as the first character
  LPTSTR cmdArgs = " name@example.com";
  </code></pre>
  
  <p>Then I get the error, then CreateProcess returns <code>TRUE</code> but my target process isn't executed.</p>
  
  <pre><code>Object reference not set to an instance of an object
  </code></pre>