ASP and language C

how to execute an exe who i create with the language C in ASP ? please give me a sample
LVL 1
ylarvorAsked:
Who is Participating?
 
jonaleeConnect With a Mentor Commented:
ASP does not directly support execute any EXE file. Not like Perl.
But, you can create an AxtiveX Server Component. In that component, you call the EXE file.

example:
<%
  Set Obj=Server.CreateObject("Comm.Commnad.1")
  Obj.Execute("d:\Hello.exe")
%>

As In the component, you need to use the function "CreateProcess" to execute the command. If you need the call return until the EXE file finish, you need to call the function "WaitForSingleObject" after call "CreateProcess"




0
 
MasseyMCommented:
Is it an executable or an ActiveX control?  If ActiveX, do this:

<%
Set YourObj = Server.CreateObjecT("Project.Class")
YourObj.Function ....
%>


0
 
MasseyMCommented:
Hey jonalee, you coode looks a lot like mine... hmmm..
0
 
jonaleeCommented:
The important of this is not code. The calling of Component is always the same. Also, ASP has only this one method to call other C++ or VB, etc code.
The important is that you need to tell him that use component as a bridge to call EXE file.
Also, you need to tell him to method to call.
One is call, then return ASAP.
The other is Call, wait for exit, then return.

:-)
0
All Courses

From novice to tech pro — start learning today.