How to handle command line arguements from simple MFC
application ?

Answers were Sorted based on User's Feedback



How to handle command line arguements from simple MFC application ?..

Answer / satheesh

Using GetCommandLineArgs() function you can get the
arguments in MFC application at any time. In InitInstance
() function you can change the behaviour of the
application using those values.

Is This Answer Correct ?    5 Yes 0 No

How to handle command line arguements from simple MFC application ?..

Answer / muthu

If it is a simple dialog based application then by using the
'theApp' application object we access commandline argument.

To get the App class object:
AfxGetApp()

To get the command line arguments
theApp->m_lpCmdLine

Use it wherever it required.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More MFC Interview Questions

what is the component of CLR ?

8 Answers   AZTEC, Symphony,


What interface must be supported by an ActiveX control?

2 Answers  


List out the parameters of WinMain Function.

2 Answers   Mphasis,


what do you mean by psychic window?

2 Answers   Patni,


How to update windows title bar dynamically?

7 Answers   HCL,


What?s the difference between Modal and Modeless Dialog?

12 Answers   Jekson, Usl India,


what is the difference between compiling and building?

1 Answers  


Hi All, I have created one MFC Dialog Based application.now if i am running the application its working fine,instead of closing he application i minimized the application,if i run the application again,i am getting the Dialog. I want to prevent the calling of application multiple times. please give me the code and let me know in which method i need to make changes. Praveer

7 Answers   HP,


Which MFC function is used to display output?

9 Answers   TCS,


1)At run-time, you can change the icon by calling the LoadIcon() function?

2 Answers  


I have 2 threads. One thread prints odd numbers and the second thread prints even numbers. Now, I have to execute the threads alternatively so that i can output 1,2,3,4,5,6,..... write code for this?

1 Answers  


What four types of properties are supported by an ActiveX control?

1 Answers  


Categories