 <p>Using a bit of psychic debugging, I'm going to guess that the strings in your application are pooled in a read-only section.</p> <p>It's possible that the CreateSysWindowsEx is attempting to write to the memory passed in for the window class or title. That would explain why the calls work when allocated on the heap (SysAllocString) but not when used as constants. </p> <p>The easiest way to investigate this is to use a low level debugger like windbg - it should break into the debugger at the point where the access violation occurs which should help figure out the problem. Don't use Visual Studio, it has a nasty habit of being helpful and hiding first chance exceptions.</p> <p>Another thing to try is to enable appverifier on your application - it's possible that it may show something.</p>