Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Corrupted arguments in WinMain

Corrupted arguments in WinMain

Scheduled Pinned Locked Moved C / C++ / MFC
helpcsharpvisual-studiojsonquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    KernKraft33
    wrote on last edited by
    #1

    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

    N T 2 Replies Last reply
    0
    • K KernKraft33

      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

      N Offline
      N Offline
      Neville Franks
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • K KernKraft33

        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

        T Offline
        T Offline
        Tim Smith
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups