Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling exe on server thru a dll

Status
Not open for further replies.

sheila11

Programmer
Dec 27, 2000
251
US
Hi,

I have a dll that calls an .exe on the server using a Shell call. (I am passing the parameters to the dll method from my asp, which come from a form on the webpage.)

Code in the dll is:
Sub Convert(s, d) 's is source-path, d is destination path
Shell ("""c:\Program files\ToGif.exe"" s=""" & s & """ d=""" & d & """ -sep")
End Sub

The .exe takes about 10 to 20 seconds to perform its task when its called from a dll. But when I debug the dll from another VB application, the control gets returned to the calling application by the dll immediately, without waiting for the .exe to complete its task, and user can perform other operation while the .exe is still working.

My question is: When used on a server to work with asp pages, will the dll behave the same way, and will users be able to fo to the next page while the .exe does its work? Or will the page have to wait till the .exe completes its work? Can I safely use this kind of an operation on a website? Will there be any problems that I should consider?

TIA,

Sheila
 
This is a post of 6 old, so I won't go into too much detail.. But it is nice to have loose ends tied for others who are searching before asking the question..

the calling dll would need to do something like this..

dim withevents MyEXE as MyEXEPrj


The EXE in the class module would need to setup an raiseevent & then call the raiseevent when it is ready to leave & return back to the DLL.

Public Event OnReturn(NextProcedure As Integer) ' this is an event to the calling Program.

Private Sub TheMainMenu_SignalEndToClassModule()
RaiseEvent OnReturn() ' This will trigger when the form closes..
' which will trigger in the calling program
' that the form has closed..
End Sub


Now once the calling program sees the events.. you will find in the field list the ref to Myexe and an event of onReturn.

Private Sub MyExe_OnReturn()
'We have Returned from the ActiveX exe

Code:
End Sub

So after you call your exe from the dll do not put any more code in that subrtn.. instead add that code to the new MyEXE_onReturn area..

It May be too late for you.. Hopefully you found your own solution.. But the answer is here for others who may be searching.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top