Invalid Argument
-
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 -
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 ThanksWhat 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)
-
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)
The thing is I don't know what it is/ what it does as visual c++ writes it for you. Thanks
-
The thing is I don't know what it is/ what it does as visual c++ writes it for you. Thanks
Just set a breakpoint on the call to
ProcessShellCommand()
. At that point, examine the app'sm_lpCmdLine
member, andcmdInfo
's members.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
-
Just set a breakpoint on the call to
ProcessShellCommand()
. At that point, examine the app'sm_lpCmdLine
member, andcmdInfo
's members.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
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.