Re: The revelation of St. f0dder the Divine



f0dder wrote:
Donkey wrote:

(...)
You should also CloseHandle pr_info.hThread



Yup, missed that one, my mistake. Thanks f0dder.

shell FRAME lpfilename,dwTimeOut

     invoke CreateProcess,NULL,[lpfilename],NULL,NULL, \
                          NULL,NULL,NULL,NULL, \
                          ADDR st_info, \
                          ADDR pr_info

     test eax,eax
     jz >.ERROR
     invoke WaitForSingleObject,[pr_info.hProcess],[dwTimeOut]
     push eax
     invoke CloseHandle,[pr_info.hProcess]
     invoke CloseHandle,[pr_info.hThread]
     pop eax
     test eax,eax
     RET
     .ERROR
     xor eax,eax
     sub eax,1
     RET
ENDF

shell PROC lpfilename:DWORD,dwTimeOut:DWORD

     invoke CreateProcess,NULL,[lpfilename],NULL,NULL, \
                          NULL,NULL,NULL,NULL, \
                          ADDR st_info, \
                          ADDR pr_info

     test eax,eax
     jz @F
     invoke WaitForSingleObject,[pr_info.hProcess],[dwTimeOut]
     push eax
     invoke CloseHandle,[pr_info.hProcess]
     invoke CloseHandle,[pr_info.hThread]
     pop eax
     test eax,eax
     RET
     @@:
     xor eax,eax
     sub eax,1
     RET
shell ENDP

Donkey
.



Relevant Pages

  • RE: Help Thread pooling ???
    ... my treeView is ona main form, the procedure I called in the thread pool is ... Or should I remove the Invoke outside of the threadpool? ... > Private Sub AddToTreeView ...
    (microsoft.public.dotnet.general)
  • Re: Threading & raising event question
    ... I don't want to use the Invoke method at all. ... Public Event Found(ByVal sender As Object, ByVal e As FoundEventArgs) ... Protected Friend Sub OnFound ...
    (microsoft.public.dotnet.languages.vb)
  • Re: threading question
    ... The control is created in the class constructor (sub New()), ... FireTest calls InvokeRequired and Invoke on the control to ensure that the ... 'It can be modified using the Windows Form Designer. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: GUI Threading and Cross Threaded Exception Question
    ... If the control handle has not yet been created, you must wait until it has been created before calling Invoke or BeginInvoke. ... Typically, this happens only if a background thread is created in the constructor of the primary form for the application ), before the form has been shown or Application.Run has been called. ... public sub new ... Dim t As New Thread) ...
    (microsoft.public.vsnet.general)
  • Re: BackGroundWorker.ProgressChanged "Cross-thread operation not valid" at 2nd/3th/... progress
    ... Control.Invoke worked just fine for me in a VS .NET 2003 add-in. ... This is my new code with Invoke, ... Private Sub bgwInfoOutlook_ProgressChanged(ByVal sender As Object, ... Control.Invoke method to run the UI update code on the UI thread. ...
    (microsoft.public.dotnet.framework)