Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_components thread: Exe on server thru a DLL?


Message #1 by "Sheila Ratnam" <sheila11@h...> on Sat, 06 Apr 2002 22:45:59 +0000
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.)
My code in the DLL is:
Sub Convert(s, d) '(s is source path, and d is destination path)
Shell ("""c:\Program files\ToGif.exe"" s=""" & s & """ d=""" & d & """ 
-sep")
End Sub

This will be on Win2k server, which I assume (but please correct me if I am 
wrong,) will take care of MTS functionality by default.

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




_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com

Message #2 by webmaster@c... on Tue, 9 Apr 2002 22:56:54
Hi Sheila
   You have opened a can of worms!  

    First, I suggest you grab a book on MTS 
   (or, since you seem to be using VB, get a good VB book that covers MTS 
     components )

    MTS is a complex subject.  Win 2K and up DO include MTS (aka COM+ ) as
an integrated part of the OS, but you have to write components to take
advantage of MTS . In this case you will want to read up on DCOM and "MTS
as an Object Request Broker" - it would take me a week of writing emails to
even start explaining MTS (and I am not an expert by any means) - so, take
the time to study MTS before you start.

    Another problem I see with your app, is that access to the app is
almost certainly going to be serialized - that is, only one user will be
able to use the exe at a time - the rest will have to "wait in line"..   An
in-process Com Server would be better ( a .dll or maybe even a java class
registered with javareg.exe)



     3rd problem - is that your calling .dll needs to wait for the .exe to
finish and return (synchronization) a result before your webserver can
create an asp page. (VB is using "Shell" to wait for completion) 10 - 20
seconds is a long wait  - you can certainly have some problems here..

 I have not had  a problem with that kind of delay on an image..
 Just off the top of my head, I would start here:

  maybe use the "lowsrc" property of the html image object  to load a temp
image so that the page can render?

  or Javascript's onLoad() function to replace a "temporary" image with the
"real" image...after the page has rendered???

   Or, display the original image (a pdf? a tif?) in a Java applet rather
than converting to a gif at all ( I am assuimg that is your purpose here)


Good Luck!





  

> 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.)
My code in the DLL is:
Sub Convert(s, d) '(s is source path, and d is destination path)
Shell ("""c:\Program files\ToGif.exe"" s=""" & s & """ d=""" & d & """ 
-sep")
End Sub

This will be on Win2k server, which I assume (but please correct me if I am 
wrong,) will take care of MTS functionality by default.

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




_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com


  Return to Index