I don't want to have to write code for MFC CCommandLine functions because
the code already exists; I just need the argc, argv parameters as given by
the user.
Cheers,
Toby.
__argc - the number of command-line arguments entered.
__argv (__targv for the international version) - an array of
null-terminated character strings which holds as many entries as there
are command-line arguments entered.
In case it's hard to read, those are double leading-underscores.
Regards,
= Jeff Andrews =
andr...@perkin-elmer.com.no-spam
(you know which part to remove to email me...)
------------------------------------------------
With BC++ you can use _argv and _argc even in a win app.
If this doesn't fix your prob you can issue a call to GetCommandLine which is
not an mfc but a simple Win API function, so you don't need to re-target your
project.
>
> Can anyone tell me how to get the classic C command line arguments (argc,
> argv) from a Windows application, whose entry point is the WinMain (or
> AfxWinMain) function?
>
> I don't want to have to write code for MFC CCommandLine functions because
> the code already exists; I just need the argc, argv parameters as given by
> the user.
>
> Cheers,
> Toby.
>
>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
CWinApp::m_lpCmdLine
Remarks
Corresponds to the lpCmdLine parameter passed by Windows to WinMain. Points
to a null-terminated string that specifies the command line for the
application. Use m_lpCmdLine to access any command-line arguments the user
entered when the application was started. m_lpCmdLine is a public variable
of type LPSTR.
Good luck!
Toby Sharp wrote in message
---------------------------------------------------
<INSERT STD DISCLAIMER HERE>
---------------------------------------------------
B. Gage Renzi
bre...@nospam.lsumc.edu
Programmer In A Box
LSU Medical Center
Dept of Cell Biology & Anatomy
New Orleans, Louisiana
---------------------------------------------------
To get entire command line use GetCommandLine();
Gudmund Thorgeirsson wrote in message
<6g2tpp$jde$1...@cenews.ehv.ce.philips.com>...