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

Thread: CreateProcess

  1. #1
    Join Date
    May 2001
    Location
    Kansas City, Missouri
    Posts
    45

    CreateProcess

    My vb project contains the following code:

    public Function LaunchApp(byval DOS_String as string)
    Dim sNull as string
    Dim lngSuccess as Long
    Dim strFileName as string
    Dim mP_Info as PROCESS_INFORMATION
    Dim mS_Info as STARTUPINFO


    mS_Info.cb = len(mS_Info)
    mS_Info.lpReserved = vbNull
    mS_Info.dwFlags = STARTF_USESHOWWINDOW
    mS_Info.wShowWindow = SW_SHOWNORMAL
    mS_Info.cbReserved2 = 0
    mS_Info.lpReserved2 = vbNull

    strFileName = App.Path & "\"
    ' strFileName = modGetShortFileName.GetDOSPath(strFileName, true)
    strFileName = strFileName & DOS_String

    'Launch the application.
    lngSuccess = CreateProcess(sNull, strFileName, 0&, 0&, _
    1&, NORMAL_PRIORITY_CLASS, 0&, sNull, mS_Info, mP_Info)
    End Function



    My problem is this: if I pass in just the name of an executable, this works fine. But as soon as I try to add command line parameters nothing happens. It doesn't seam to make any difference whether I pass "param1, param2" or "param1,param2" or "param1 param2". I have even tried variations where the first parameter of the function call gets the app name and the second parameter gets the parameter string. No variation I have tried makes any difference. The weird thing is that I'm not even getting an error. Either I pass in just the name of an executable and it works, or I pass in an executable and a parameter list and I get nothing.

    Does anybody know what I might be doing wrong?

    Thanks in advance.


  2. #2
    Join Date
    May 2001
    Location
    Kansas City, Missouri
    Posts
    45

    Re: CreateProcess

    Sorry, I meant to put this in the API category.


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