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. Invalid Argument

Invalid Argument

Scheduled Pinned Locked Moved C / C++ / MFC
help
5 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.
  • S Offline
    S Offline
    sschilachi
    wrote on last edited by
    #1

    When I run my program I get an error message box saying: An invalid argument was encountered. I tracked the error down to the following function in CWinApp: ProcessShellCommand(cmdInfo) Does anyone know why this is happening Thanks

    D 1 Reply Last reply
    0
    • S sschilachi

      When I run my program I get an error message box saying: An invalid argument was encountered. I tracked the error down to the following function in CWinApp: ProcessShellCommand(cmdInfo) Does anyone know why this is happening Thanks

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      What arguments are being passed to your application? Have you looked at the data members of the cmdInfo object?


      "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

      S 1 Reply Last reply
      0
      • D David Crow

        What arguments are being passed to your application? Have you looked at the data members of the cmdInfo object?


        "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

        S Offline
        S Offline
        sschilachi
        wrote on last edited by
        #3

        The thing is I don't know what it is/ what it does as visual c++ writes it for you. Thanks

        D 1 Reply Last reply
        0
        • S sschilachi

          The thing is I don't know what it is/ what it does as visual c++ writes it for you. Thanks

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Just set a breakpoint on the call to ProcessShellCommand(). At that point, examine the app's m_lpCmdLine member, and cmdInfo's members.


          "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

          R 1 Reply Last reply
          0
          • D David Crow

            Just set a breakpoint on the call to ProcessShellCommand(). At that point, examine the app's m_lpCmdLine member, and cmdInfo's members.


            "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

            R Offline
            R Offline
            rhfritz1
            wrote on last edited by
            #5

            This response has nothing to do with this thread except that I found this thread when searching for the cause of this error message. In my case, I had serialized a CStringArray object to a file using a CArchive. Somehow the file became corrupted, overwritten/filled with zeros, when my machine was shut down. When I restarted my machine and my application attempted to load this file, I got the "An invalid argument was encountered" message box. The solution was to use some easily testable numeric values that had already been written in the file prior to the CStringArray as a means to determine if the file was corrupt. At that point my logic treats a corrupt file in the same manner as a non-existent one and simply re-creates it. I've posted this here in the hope my experience might help someone else.

            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