?
Solved

Out of Process ActiveX exe

Posted on 2001-08-06
10
Medium Priority
?
226 Views
Last Modified: 2006-11-17
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
0
Comment
Question by:jonesian
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +3
10 Comments
 
LVL 11

Expert Comment

by:Otana
ID: 6355563
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.
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 6355581
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
0
 

Author Comment

by:jonesian
ID: 6355594
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(.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:jonesian
ID: 6355603
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

0
 
LVL 11

Expert Comment

by:Otana
ID: 6355615
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.
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 6355629
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
0
 
LVL 3

Accepted Solution

by:
rondi earned 300 total points
ID: 6355757
Create an EXE that'll run in the background, with a thread/timer processing some sort of queue of requests.
The queue will be a singleton COM object that client objects can add to. The ASP pages create instances of the
client objects to add to the queue or add to the queue object directly.
Only one instance of the EXE should ever run (use a Mutex
for this) and it HAS to be foolproof.

Good luck,
rondi.
0
 
LVL 1

Expert Comment

by:jendrix
ID: 6356144
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).
0
 

Expert Comment

by:teacher_mod
ID: 6374522
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


0
 

Author Comment

by:jonesian
ID: 6379345
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
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question