Link to home
Start Free TrialLog in
Avatar of jonesian
jonesian

asked on

Out of Process ActiveX exe

The Problem :

Process takes too long for an ASP to process itself, page times out and it looks bad to the user if they have to wait around.  I need to put it out of process.

The solution? :

A VB ActiveX exe that returns to the client immediately and processes in the background.

How would I go about writing this?  I've read up on WithEvents, then found ASP doesn't support it.  I'm a tad stuck.

Any recommendations would be much appreciated.

Ian
Avatar of Otana
Otana

you could set your response.buffer=false

this would show all items on the page the instant they are loaded, and you can do other actions at the bottom of the page. The page would not be fully loaded until everything has been executed.
You NEED an inprocess server for this. Out of process returns the control directly back to ASP, and can thus not ever get any information out of the out-of-process server.

The only thing you can do is set the timeout some higher and use an inprocess component.

Server.SetTimeout = 20000

regards,
CJ
Avatar of jonesian

ASKER

Thanks for the suggestion.  A good idea which I wish my predecessor had thought of.  

Unfortunately he wrote it with Buffer set to true so he could use Response.Redirect anywhere in the code.

I have a deadline of tommorrow, and would need to rewrite 2500 lines of (uncommented) code :o(.
CJ,

I'm not wanting any info back from it.  It will have its own error handling.

Also that is exactly what I want to happen, for the process to return control back to the ASP immediately.

Regards

Ian

I'm sorry to hear that. I'm afraid I can't think of anything else right now, except do a find&replace of all the response.redirect and replace them with:

Response.Write ("<script>parent.location='./../test.asp'</script>")

this would place a script block in your code that will be executed immediately after the server-side script has been executed.
There is no need for the withevents then. WithEvents is only necessary if your code needs to know when something has finished.

You should be able to get to the object using the getObject function

Set x = getObject("", "BLAH.BLOEH")

and use the functions provided.

regards,
CJ
ASKER CERTIFIED SOLUTION
Avatar of rondi
rondi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Just a thought: I'm not into ASP programming, so my tip might not be useful:

If you use on Active-X EXE and you want it to return the control directly to the calling program, just use a timer object.
Start the timer in the entry-function of your active-x Exe, then end this function. The calling prog. can resume its execution. In the timer event of the active-x exe you can start the function that you wanted.
The easiest way is to use a hidden form in your active-x exe. There is sample code for this in the vb studio (coffee).
jonesian,

While you are on the site could you take a few minutes to update or close out your previous question which is now two months old.

teacher_mod
Community Support Moderator
Experts-Exchange
teacher_mod@experts-exchange.com


I've based my solution on this idea.

I've decided to run it as a service instead of an ActiveX exe, but will use a queue.

Thanks

Ian