vipin <an*******@discussions.microsoft.com> wrote:
My C# console application takes 5 parameters two of which are
supposed to be inherently integers.
So I do COnvert.ToInt32(args[3]).
There is no problem with the console application when I run it at the
command prompt.
But the above statement raises an exception when I use
CreateProcess(NULL,CommandLine
...) from a C++ code.
I have the c# code compiled with /unsafe option.
What is the workaround to this problem with Convert class?
My guess is that's it's actually not a problem with the Convert class
at all, but with the parameter that you're passing in.
I suggest you get the C# program to print out what args[3] is before
trying to convert it, so you can see what's likely to be wrong.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too