title: Access Violation in function CreateProcess in Delphi 2009
body: <p>In my program I've the following code:</p>
  
  <pre><code>//Code
   if not CreateProcess(nil, NonConstCmd, nil, nil, True, NORMAL_PRIORITY_CLASS or
      CREATE_NEW_PROCESS_GROUP, nil, PCh, SI, P) then
  //Code
  </code></pre>
  
  <p>And I keep getting Access violation error.
  By the way, in Delphi7 the same code works perfectly.
  I've read MSDN and found that CreateProcess function in Delphi can modify the second argument.
  Inititally It was const, that's why I create a new variable with the same value.
  But it takes no effect.</p>
  
  <p>The question is: why doesn't this code work?</p>