Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: ASP Objects
Expertise: Beginner
Jul 7, 1999

Accessing an Existing Instance of an Object in IIS

Question:

I have an app exposing a connector class that returns a reference to a single internal global object. This app runs continuously and I want to display status info in an ASP page. When I run code in ASP to do this, it creates a second instance of the EXE. How do I get IIS to use the existing instance?

Answer:

After you create the object the first time, you could place it in the Application Object. The next time you want to access it, retrieve it from the Application object.

Pseudocode:
If Application("MyInstance") is Nothing Then
   Create the Object
   Do what you want with it
   Place it in the Application Object 
   (set Application("MyInstance") = The object)
Else
   Do what you want with it
end if
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date