Corrupted arguments in WinMain
-
I've been experiencing a strange anomaly at runtime with a Windows API based exe. When stepping through my WinMain function, I realised that the arguments passed to it by Windows (HINSTANCE, HINSTANCE, CHAR*, INT) are basically corrupted. The two HINSTANCEs are always 0 and the last two arguments are different every time (ex. -15423002). Has anyone else encountered this sort of problem? Note:I had a linking error before: 'unresolved external wWinMainCRTStart' or something like that that I kludged by setting the property Advanced>Entry Point to 'WinMain'; could this be the reason? By the way I used VS.NET 2003 to compile and link. kern
-
I've been experiencing a strange anomaly at runtime with a Windows API based exe. When stepping through my WinMain function, I realised that the arguments passed to it by Windows (HINSTANCE, HINSTANCE, CHAR*, INT) are basically corrupted. The two HINSTANCEs are always 0 and the last two arguments are different every time (ex. -15423002). Has anyone else encountered this sort of problem? Note:I had a linking error before: 'unresolved external wWinMainCRTStart' or something like that that I kludged by setting the property Advanced>Entry Point to 'WinMain'; could this be the reason? By the way I used VS.NET 2003 to compile and link. kern
KernKraft33 wrote: Note:I had a linking error before: 'unresolved external wWinMainCRTStart' or something like that that I kludged by setting the property Advanced>Entry Point to 'WinMain'; could this be the reason? By the way I used VS.NET 2003 to compile and link. Sounds like a reasonably bet to me. Mind you I'm not using VS.NET. Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
-
I've been experiencing a strange anomaly at runtime with a Windows API based exe. When stepping through my WinMain function, I realised that the arguments passed to it by Windows (HINSTANCE, HINSTANCE, CHAR*, INT) are basically corrupted. The two HINSTANCEs are always 0 and the last two arguments are different every time (ex. -15423002). Has anyone else encountered this sort of problem? Note:I had a linking error before: 'unresolved external wWinMainCRTStart' or something like that that I kludged by setting the property Advanced>Entry Point to 'WinMain'; could this be the reason? By the way I used VS.NET 2003 to compile and link. kern
The answer would be yes. The prototype of wWinMainCRTStart is "int x (void)". So replacing that with a "int (HI, HI, CHAR*, int) routine would result in all sorts of funning things going on. Tim Smith I'm going to patent thought. I have yet to see any prior art.