Re: main() command line arguments of console application



Does
http://groups-beta.google.com/group/microsoft.public.windowsce.embedded.vc/browse_frm/thread/31ef446e75a77110/447e086c21d66afb?q=spaith+warrington&rnum=1&hl=en#447e086c21d66afb
help? You have to have the EXE built with the right entry points. I think
you'd want mainACRTStartup for ANSI.

--
John Spaith
Software Design Engineer, Windows CE
Microsoft Corporation

Check out the new CE Networking Team Blog at http://blogs.msdn.com/cenet/.

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2003 Microsoft Corporation. All rights
reserved.

"Jimbo" <cjavajim@xxxxxxxxx> wrote in message
news:1120147511.556096.59750@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>I want to use command line arguments in a console application. Yet
> regardless of what was entered on the command line, argc and argv
> contain bogus values. Why?
>
> Setup:
>
> Platform Builder 5.0, target is a CEPC, and yes, the OS does include
> the console component.
>
> Embedded VC++ 4.0 with SP4.
>
> Code:
>
> int main (int argc, char *argv[])
> {
> printf("argc = %d (0x%0X), argv = %s\n",
> argc, argc, argv ? argv[0] : "NULL");
>
> getchar();
>
> return 0;
> }
>
> Sample output:
>
> argc = 981293930 (0x3A7D5B6A), argv = NULL
>
> Issue: the command line arguments contain bogus values regardless of
> what was entered on the command line. That is, regardless of _how
> many_ (argc) values I entered, argc is always incorrect and argv is
> always NULL.
>


.



Relevant Pages

  • main() command line arguments of console application
    ... I want to use command line arguments in a console application. ... regardless of what was entered on the command line, argc and argv ... contain bogus values. ...
    (microsoft.public.windowsce.embedded)
  • Re: What does "*" mean in "int main(int argc, char *argv[])"?
    ... argv- is the array of parameters passed in the command line. ... it is a pointer to an array of type char. ... You can use argc in a for loop to process the argv[] values. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: cpmmand line arguments
    ... You cannot compile or run command line arguments. ... Obviously argc and argv can be any legal identifier but these two names ... The general method is to first test argc. ...
    (comp.lang.c)
  • [PS] Ignoring host formatting
    ... If I want to get all the information from a command in a nice format ... regardless of the number of columns available, ... cmdlet/pipeline into single rows? ...
    (microsoft.public.windows.server.scripting)
  • How to parse a string like C program parse the command line string?
    ... I want to parse a string like C program parse the command line into ... argc & argv. ... I hope don't use the array the allocate a fix memory first, ...
    (comp.lang.c)