I've created a dialog application using the MFC app wizard. Within that
application I want to access the command line arguments. How do I do this?
Also, when I enter a command line such as: "fcheck /o c:\temp\test.tmp" the
app (not my program) displays a dialog box that says c:\temp\test.tmp was
not found. Where is this coming from? I'm looking for the argc and argv
functionality.
It seems a whole lot easier in standard C or am I just making this more
difficult than it is...
Thanks in advance.
The argc/argv variables are available. Prepend with double underscore:
BOOL CApp::InitInstance()
{
int c = __argc;
char** pv = __argv;
There is some MFC command line support available in the ParseCommandLine MFC
function and the CWinApp object contains a member m_lpCmdLine.
Yep, it's a whole lot easier in standard C. It's a whole lot more usable and
saleable in Windows, though. There is much to learn :)
--
Scott McPhillips [VC++ MVP]
This will return the entire command line, including the path to the
executable, unless your are running NT, where you don't get the path,
just the executable.
It's up to you to parse the returned string.
In article <8rnta...@enews3.newsguy.com>,
"Paul Baker" <pbak...@mindspring.com> wrote:
> I'm new to Visual C++... Using Visual C++ 6.0
>
> I've created a dialog application using the MFC app wizard. Within
that
> application I want to access the command line arguments. How do I do
this?
> Also, when I enter a command line such as: "fcheck /o
c:\temp\test.tmp" the
> app (not my program) displays a dialog box that says c:\temp\test.tmp
was
> not found. Where is this coming from? I'm looking for the argc and
argv
> functionality.
>
> It seems a whole lot easier in standard C or am I just making this
more
> difficult than it is...
>
> Thanks in advance.
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Thanks!