p*****e 发帖数: 58 | 1
if your server side program is an exe (non-COM), you can
write a simple COM class using VB. Within the COM you use
the "Shell" function to start the executable. The reason you
need VB is that ASP (actually its scripting language
VBScript) can not call Shell directly.
If your executable is a COM program, you can create objects
of that program directly in your ASP code, and your program
will automatically start. |
N**e 发帖数: 158 | 2 It's not that easy. Since ASP calls COM as a backend service, a simple shell
call will start the program(e.g. notepad), but the program can only run as
a service with no windows... If you want to run graphical programs you need to
do more.
【在 p*****e 的大作中提到】 : : if your server side program is an exe (non-COM), you can : write a simple COM class using VB. Within the COM you use : the "Shell" function to start the executable. The reason you : need VB is that ASP (actually its scripting language : VBScript) can not call Shell directly. : If your executable is a COM program, you can create objects : of that program directly in your ASP code, and your program : will automatically start.
|
e*****n 发帖数: 11 | 3
Ah, then what else should I do?
【在 N**e 的大作中提到】 : It's not that easy. Since ASP calls COM as a backend service, a simple shell : call will start the program(e.g. notepad), but the program can only run as : a service with no windows... If you want to run graphical programs you need to : do more.
|
e*****n 发帖数: 11 | 4
I have made a simple COM using VB, it runs good in VB and
can start an .exe
file, but when I try to call the method in asp, it does not
work. The IE just go over the asp page and did nothing.
Here is how I call the method in asp:
<%
Dim oDoc
Set oDoc = Server.CreateObject("test.ClsServer")
oDoc.trigger
%>
test is the name of the COM, ClsServer is the class name and
the trigger is the method name.
Can you see any problem?
Thanks.
【在 p*****e 的大作中提到】 : : if your server side program is an exe (non-COM), you can : write a simple COM class using VB. Within the COM you use : the "Shell" function to start the executable. The reason you : need VB is that ASP (actually its scripting language : VBScript) can not call Shell directly. : If your executable is a COM program, you can create objects : of that program directly in your ASP code, and your program : will automatically start.
|
N**e 发帖数: 158 | 5 It's run at backend. You can use the task manager to see there will be one
instance of program
【在 e*****n 的大作中提到】 : : I have made a simple COM using VB, it runs good in VB and : can start an .exe : file, but when I try to call the method in asp, it does not : work. The IE just go over the asp page and did nothing. : Here is how I call the method in asp: : <% : Dim oDoc : Set oDoc = Server.CreateObject("test.ClsServer") : oDoc.trigger
|
e*****n 发帖数: 11 | 6
No, I can not find it.
【在 N**e 的大作中提到】 : It's run at backend. You can use the task manager to see there will be one : instance of program
|
N**e 发帖数: 158 | 7 I can find the program executed by my COM in the process list.
【在 e*****n 的大作中提到】 : : No, I can not find it.
|
e*****n 发帖数: 11 | 8
Really? The is your .dll look likes following(I did it in
VB)?
Public Sub trigger()
Dim RetVal
RetVal = Shell("c:\windows\write.exe",1)
End Sub
Also, do you use asp page to try to trigger?
Thanks
【在 N**e 的大作中提到】 : I can find the program executed by my COM in the process list.
|
N**e 发帖数: 158 | 9 I use VC
【在 e*****n 的大作中提到】 : : Really? The is your .dll look likes following(I did it in : VB)? : Public Sub trigger() : Dim RetVal : RetVal = Shell("c:\windows\write.exe",1) : End Sub : Also, do you use asp page to try to trigger? : Thanks
|
e*****n 发帖数: 11 | 10
Well, then can you offer me your source code? I am not
familiar with VC and the deadline is coming, please. I will
be very appreciate.
Thanks
【在 N**e 的大作中提到】 : I use VC
|
N**e 发帖数: 158 | 11 I am quite busy and I don't have the source on my hand. I'll be able to get
that in about 1 week. But you can get the answer via the google.
【在 e*****n 的大作中提到】 : : Well, then can you offer me your source code? I am not : familiar with VC and the deadline is coming, please. I will : be very appreciate. : Thanks
|
p*****e 发帖数: 58 | 12 How long do you expect your program to run? if it finishes
within a second, you will not see it even with the task
manager.
【在 e*****n 的大作中提到】 : : Well, then can you offer me your source code? I am not : familiar with VC and the deadline is coming, please. I will : be very appreciate. : Thanks
|
e*****n 发帖数: 11 | 13
I searched via the google, but I have not find the answer
yet. Can you offer me the source? I think one week is fine.
Please email to z***[email protected] with the source as an
attachment, thanks.
【在 N**e 的大作中提到】 : I am quite busy and I don't have the source on my hand. I'll be able to get : that in about 1 week. But you can get the answer via the google.
|
e*****n 发帖数: 11 | 14
I just want a GUI to be triggered(like a notepad to be start
up), I don't think it will be closed within a second.
【在 p*****e 的大作中提到】 : How long do you expect your program to run? if it finishes : within a second, you will not see it even with the task : manager.
|