Question on CreateProcess / WinExec... - Programmer

This is a discussion on Question on CreateProcess / WinExec... - Programmer ; I'm using a call to WinExec, but in trying to get my code to compile under unicode, this call is not supported. I'm looking at CreateProcess and it looks like it requires you to close some handles or you'll leak. ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Question on CreateProcess / WinExec...

  1. Question on CreateProcess / WinExec...

    I'm using a call to WinExec, but in trying to get my code to compile under
    unicode, this call is not supported. I'm looking at CreateProcess and it
    looks like it requires you to close some handles or you'll leak. But WinExec
    works in an async way, how can I make CreateProcess work in an async way and
    not leak those handles?



  2. Re: Question on CreateProcess / WinExec...

    No problem. Just do a CloseHandle(proc.hProcess); after your call to
    CreateProcess( ... ). Your launched program keeps running.

    --
    ---------------------------------------------------------------------
    DataGet® & PocketLog® www.dataget.com
    Data Collectors www.baxcode.com
    --------------------------------------------------------------------



    "Nobody" wrote in message
    news:g4nUf.53$5k1.27@fed1read06...
    > I'm using a call to WinExec, but in trying to get my code to compile under
    > unicode, this call is not supported. I'm looking at CreateProcess and it
    > looks like it requires you to close some handles or you'll leak. But

    WinExec
    > works in an async way, how can I make CreateProcess work in an async way

    and
    > not leak those handles?
    >
    >




  3. Re: Question on CreateProcess / WinExec...

    Take a look at ShellExecuteEx() as well. That might work better for you.
    WinExec() is so "not any more" )

    Tom

    "Nobody" wrote in message
    news:g4nUf.53$5k1.27@fed1read06...
    > I'm using a call to WinExec, but in trying to get my code to compile under
    > unicode, this call is not supported. I'm looking at CreateProcess and it
    > looks like it requires you to close some handles or you'll leak. But
    > WinExec works in an async way, how can I make CreateProcess work in an
    > async way and not leak those handles?
    >
    >




+ Reply to Thread