Command line arguments in MFC
As if the subject wasn''t obvious enough :-) does anyone know how to get command line arguments in MFC?
Thanks
-----------------------------
How _not_ to give a presentation for work:
"Now, this part is really cool...uh, oh! I know why that happened. I was changing some of that code today and forgot to change this file! I''ll be right back." *running*.....
*running*
"What line was that?"
-=xelius=-
-------------------"Pointer?" -Anonymous-=Xelius=-
search msdn yet? I haven''t needed that, but it sounds useful.
You mean to parse, not how to send them from the compile right?
Magmai Kai Holmlor
- The disgruntled & disillusioned
You mean to parse, not how to send them from the compile right?
Magmai Kai Holmlor
- The disgruntled & disillusioned
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
This works for Win32, so I''m assuming there''s no change.
In the windows headers there are two global variables which always hold the cmdline:
char** __argv;
int __argc;
You should be able to just use those.
--------------------------
I guess this is where most people put a famous quote...
"Everything is funnier with monkey''''s" - Unknown
In the windows headers there are two global variables which always hold the cmdline:
char** __argv;
int __argc;
You should be able to just use those.
--------------------------
I guess this is where most people put a famous quote...
"Everything is funnier with monkey''''s" - Unknown
--------------------------I guess this is where most people put a famous quote..."Everything is funnier with monkey''s" - Unknown
I hadn''t had the time to search MSDN fully because the one time I tried, with the 5 minutes I had, all sorts of interesting things came up.
I actually found another jumping through the MFC code:
theApp.m_lpCmdLine
Where theApp is the application object that is created for you when you generate your code with the App Wizard.
This gives you the entire command line. I''m glad you replied, though. I was hoping there was something more along those lines.
Thanks!
-----------------------------
How _not_ to give a presentation for work:
"Now, this part is really cool...uh, oh! I know why that happened. I was changing some of that code today and forgot to change this file! I''ll be right back." *running*.....
*running*
"What line was that?"
-=xelius=-
I actually found another jumping through the MFC code:
theApp.m_lpCmdLine
Where theApp is the application object that is created for you when you generate your code with the App Wizard.
This gives you the entire command line. I''m glad you replied, though. I was hoping there was something more along those lines.
Thanks!
-----------------------------
How _not_ to give a presentation for work:
"Now, this part is really cool...uh, oh! I know why that happened. I was changing some of that code today and forgot to change this file! I''ll be right back." *running*.....
*running*
"What line was that?"
-=xelius=-
-------------------"Pointer?" -Anonymous-=Xelius=-
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement