how to get command line arguments in MFC
-
Hi, I need to execute my project exe through command prompt. 1) If I give path of exe in command prompt(one argument) then it should execute GUI version of Project. 2) If I give two arguments in command prompt then it should execute CLI version of Project. How can I get command line arguments In MFC.In windows programming we are having int _tmain(int argc, _TCHAR* argv[]) main function.But how can I do it in MFC.
-
Hi, I need to execute my project exe through command prompt. 1) If I give path of exe in command prompt(one argument) then it should execute GUI version of Project. 2) If I give two arguments in command prompt then it should execute CLI version of Project. How can I get command line arguments In MFC.In windows programming we are having int _tmain(int argc, _TCHAR* argv[]) main function.But how can I do it in MFC.
hemlat wrote:
But how can I do it in MFC.
You have access to
__argc
and__argv
whether you use MFC or not. Also check out the app'sm_lpCmdLine
member."Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
hemlat wrote:
But how can I do it in MFC.
You have access to
__argc
and__argv
whether you use MFC or not. Also check out the app'sm_lpCmdLine
member."Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
Hi, I need to execute my project exe through command prompt. 1) If I give path of exe in command prompt(one argument) then it should execute GUI version of Project. 2) If I give two arguments in command prompt then it should execute CLI version of Project. How can I get command line arguments In MFC.In windows programming we are having int _tmain(int argc, _TCHAR* argv[]) main function.But how can I do it in MFC.
there are a bunch of command line parser classes out there, to take care of splitting the cmd line into flags and options. for example: CCmdLine - command line parser[^]
-
Hi, I need to execute my project exe through command prompt. 1) If I give path of exe in command prompt(one argument) then it should execute GUI version of Project. 2) If I give two arguments in command prompt then it should execute CLI version of Project. How can I get command line arguments In MFC.In windows programming we are having int _tmain(int argc, _TCHAR* argv[]) main function.But how can I do it in MFC.