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

    IS IT POSSIBLE TO SEND PARAM????

    Hi,

    Is it possible to pass parameters to mfc application (dialog based) when it is invoked??. ie I have vc++ application APP1, using CreateProcess(...) launches another vc++ app(dialog based) APP2, How to gather the parameters sent from the CreateProcess() in the APP2.

    Thanx


  2. #2
    Join Date
    May 1999
    Location
    Wisconsin, USA
    Posts
    953

    Re: IS IT POSSIBLE TO SEND PARAM????

    You can do something like this in the program using createProcess:

    char pathStr[MAXPATH] = "c:\myPath\myProgram.exe";
    char commandLine[100] = "1 1 0";

    CreateProcess(pathStr,
    commandline,
    NULL,
    NULL,
    FALSE,
    NORMAL_PRIORITY_CLASS,
    NULL,
    NULL,
    &suInfo,
    &procInfo);

    In the program that is being executed do something like this...


    LPTSTR pCommandLine;
    pCommandLine = GetCommandLine();

    if(pCommandLine == NULL)
    {
    // error
    }




  3. #3
    Guest

    Re: IS IT POSSIBLE TO SEND PARAM????

    Thanx a lot. I got it working.




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