CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    May 1999
    Posts
    37

    Launching external appz

    how would i launch an external app(in my case Microsoft Word or Corel WordPerfect) from within my application? how could i set it up to load a text file upon startup?
    thanks
    L5


  2. #2
    Join Date
    May 1999
    Location
    OR, USA
    Posts
    65

    Re: Launching external appz

    Use CreateProcess.
    pass "fullPath\winword.exe yourfile.txt" as a parameter (I think it's cmdline)
    and pass NULL as parameter for appname.



  3. #3
    Join Date
    May 1999
    Posts
    37

    Re: Launching external appz

    thanks for the post, but one question...
    in VC++ 6 i call teh global create Process like this:

    ::CreateProcess(...);



    now, when i do that, it wants about 20 different things in the parenthesis. what do i put for them?
    thanks,
    L5


  4. #4
    Join Date
    Apr 1999
    Posts
    45

    Re: Launching external appz

    If you don't need to WaitforObject() try ShellExecute() its easier to work with than CreateProcess.

    Gordito


  5. #5
    Join Date
    May 1999
    Location
    OR, USA
    Posts
    65

    Re: Launching external appz

    Look for online help.
    The only important ones are appname and cmdline. You can pass null to appname.
    in cmd line "fullpath\app.exe param1 param2".
    2 more parameters are si and pi, declare the structures as shown in help and init them as:

    memset(&si, 0, sizeof(si));
    si.cbSize = sizeof(si);
    memset(&pi, 0, sizeof(pi));
    pi.cbSize = sizeof(pi);




    All other params are null.



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