CreateProcess

Discussion in 'C++' started by baje, Apr 15, 2007.

  1. baje

    baje Guest

    hi everyone, need some help;
    have this code to open MS Word using CreateProcess; but it is not
    working; what am i missing?
    CreateProcess(NULL, "Winword.exe", NULL, NULL, FALSE, 0,
    NULL, NULL, &si, &pi);
     
    baje, Apr 15, 2007
    #1
    1. Advertising

  2. baje wrote:
    > hi everyone, need some help;
    > have this code to open MS Word using CreateProcess; but it is not
    > working; what am i missing?
    > CreateProcess(NULL, "Winword.exe", NULL, NULL, FALSE, 0,
    > NULL, NULL, &si, &pi);


    You should ask about this in the Windows programming newsgroup.
    See FAQ for suggestions.

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
     
    Victor Bazarov, Apr 15, 2007
    #2
    1. Advertising

  3. baje

    Zeppe Guest

    baje wrote:
    > hi everyone, need some help;
    > have this code to open MS Word using CreateProcess; but it is not
    > working; what am i missing?
    > CreateProcess(NULL, "Winword.exe", NULL, NULL, FALSE, 0,
    > NULL, NULL, &si, &pi);
    >


    Not surprised, MS Word doesn't usually work.

    Regards,

    Zeppe
     
    Zeppe, Apr 16, 2007
    #3
  4. baje

    Maxim.Popov. Guest

    On Apr 15, 8:13 pm, "baje" <> wrote:
    > hi everyone, need some help;
    > have this code to open MS Word using CreateProcess; but it is not
    > working; what am i missing?
    > CreateProcess(NULL, "Winword.exe", NULL, NULL, FALSE, 0,
    > NULL, NULL, &si, &pi);


    ApiFucntion CreateProcess doesn't use relative paths and environment
    variables. You should call function ShellExecuteEx. ShellExecuteEx
    looks at the paths of environment variable "Path". For example:


    SHELLEXECUTEINFOW execInfo;

    ZeroMemory(&execInfo, sizeof(execInfo));

    execInfo.cbSize = sizeof(execInfo);
    execInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
    execInfo.nShow = SW_SHOWNORMAL;
    execInfo.lpFile = L"Winword.exe";

    ShellExecuteEx(&execInfo);
     
    Maxim.Popov., Apr 17, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kroum Grigorov
    Replies:
    1
    Views:
    711
    Christopher Benson-Manica
    Apr 26, 2004
  2. Elly Sokol

    CreateProcess

    Elly Sokol, Jun 17, 2004, in forum: C++
    Replies:
    13
    Views:
    4,440
    Frederic Banaszak
    Jun 18, 2004
  3. Baskar

    Createprocess

    Baskar, Jan 20, 2005, in forum: C++
    Replies:
    1
    Views:
    458
    Victor Bazarov
    Jan 20, 2005
  4. Replies:
    1
    Views:
    3,745
    Roland de Ruiter
    Jun 28, 2006
  5. Achim Domma

    CreateProcess / redirect output

    Achim Domma, May 28, 2004, in forum: Python
    Replies:
    2
    Views:
    7,277
    Achim Domma
    May 28, 2004
Loading...

Share This Page