Weird issue when launching processes.

Discussion in 'Microsoft VC .NET' started by MacScotsman, Nov 2, 2010.

  1. MacScotsman

    MacScotsman Guest

    I'm responsible for a piece of a launching app of a larger piece of
    legacy software. My app is the starting point for the client side.
    Running my application (VC++) kicks off a few self terminating process
    to check file versions, etc... and finally launches a seperate
    application (outside my control) and closes itself. This second
    application then launches a third. This 3rd app launches a 16 bit app
    to access data. The third app also launches a seperate 16 bit app
    which needs to use the first 16 bit app to access data as well.

    My problem is that when I run my app, the 2 16 bit apps down launch
    under the same instance of NTVDM for the first attempt only. Once the
    app is shut down, all subsequent attempts will launch the 16 bit apps
    under seperate NTVDMs, causing the application to hang.

    If I run the 2nd app in the chain directly, it works correctly
    everytime. Presumably, I'm launching the 2nd app incorrectly from the
    my application, but I can't figure out what the issue could be.

    I'm currently using the following code to launch the 2nd app.

    STARTUPINFOW si = { sizeof si };
    si.dwFlags = STARTF_USESHOWWINDOW;
    si.wShowWindow = show_cmd;
    if (!::CreateProcessW(
    app_name,
    const_cast<wchar_t*>(cmd_line),
    NULL,
    NULL,
    TRUE,
    0,
    NULL,
    NULL,
    &si,
    &m_pi))
    {
    std::blush:stringstream os;
    os << "Could not create process \"" << app_name << "\": ";
    throw OS::Error(os.str(), ::GetLastError());
    }

    I'd appreciate any help anyone could provide (or at least a direction
    to go in)... I've tried a number of things, but I'm not really a C++
    developer, so my kung-fu is not that string. :)
     
    MacScotsman, Nov 2, 2010
    #1
    1. Advertisements

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. Replies:
    6
    Views:
    190
    Willy Denoyette [MVP]
    Feb 7, 2006
  2. Jay
    Replies:
    8
    Views:
    281
    Alex Blekhman
    Jun 13, 2006
  3. R.Kaiser

    Launching Word from Visual C++ 2005

    R.Kaiser, Oct 8, 2006, in forum: Microsoft VC .NET
    Replies:
    2
    Views:
    160
    R.Kaiser
    Oct 15, 2006
  4. Guest

    Launching one CWinFormsDialog from another

    Guest, Oct 23, 2007, in forum: Microsoft VC .NET
    Replies:
    3
    Views:
    247
    Guest
    Oct 24, 2007
  5. Mesan
    Replies:
    14
    Views:
    591
    Mesan
    Oct 1, 2008
Loading...

Share This Page