CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: argc argv

  1. #1

    argc argv

    How can I get the Argument in the MFC program.

    Do they support the special member value or function in the MFC?




  2. #2
    Join Date
    Feb 2001
    Location
    Sydney, Australia
    Posts
    1,909

    Re: argc argv

    CWinApp::m_lpCmdLine
    CWinApp::ParseCommandLine

    Please - rate answer if it helped you
    It gives me inspiration when I see myself in the top list =)

    Best regards,

    -----------
    Igor Soukhov (Brainbench/Tekmetrics ID:50759)
    [email protected] | ICQ:57404554 | http://soukhov.com

    Member of Russian Software Developer Network http://rsdn.ru
    Best regards,
    Igor Sukhov

    www.sukhov.net

  3. #3
    Join Date
    Mar 2000
    Location
    Bangalore,India
    Posts
    776

    Re: argc argv

    Hi
    You can use directly the
    LPTSTR GetCommandLine(VOID); function in InitInstance() function of ur application class before initialization. This will return a string which u can parse to get the options.

    OR
    look at the CwinApp: functions, and CCommandLineInfo class.

    CWinAPp::ParseCommandLine(cmdInfo);

    Regards
    S.K.Pradhan



    Be sure to rate answers if it helped, to encourage them.

  4. #4
    Join Date
    Jun 2001
    Location
    Lewes, UK
    Posts
    1,313

    Re: argc argv

    The argc and argv of a traditional C program are available to you in __argc and __targv[] and the whole command line is in CWinApp::m_lpCmdLine.

    Hope this helps

    Eugene Gill

    Please take the time to reply and/or rate this answer if you found it useful.

    Other readers will then be better informed.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured