We help IT Professionals succeed at work.

Newbie Question - VB6 GetObject in .net

Medium Priority
Last Modified: 2008-02-26
Hi all

This will be a real easy one I imagine but thought I'd ask anyway - I'm writing a software package that has both web and windows form components that share a common data access layer. One ofthe requirements is to manage the number of concurrent licences used on both platforms. I want to create what in old VB6 in an ActiveX Exe that stays in memory and my apps simply add the users names in and out when they log in/out. I also want to be able to return these detals from the class for admin purposes.

In VB6 I would create a ActiveX and run it then use getObject to get a reference the app. What the equivilent or best pratice to do this in .net.

Many thanks in advance

Watch Question

 In .NET there is no concept of ActiveX Exe or ActiveX DLL. Probably u can use Class library project (.DLL) to achieve ur requirement.



Actually found what I was looking for - the Shared keyword for variables was exactly what I was looking for

cheers anyway
 Shared variables are created in the Global memory (heap) and it will be available through out the application  life time. Shared is equivalent to Static in C++.  These Shared variables or methods are not bound to the class. So they will be available anywhere inside the project. They will be created in the global memory only once when they are invoked.



Yep - thats pretty much what I was looking for. Basically I will have a class that stores user details so that we can cap the number of users and also retreive the details while the ASP.net application is active.  I didn't want to have to connect to a database each time someone logs in via the web to update the info.

thanks again for your comments




There is an alternative way I suppose - I could just create an standard windows exe and not have it dispay anything - is there any benefit to doing it that rather than using a class with shared variables ? I think using the shared variables is a bit tidier but am not sure if they have any impact on performance/load etc.
Unlock this solution and get a sample of our free trial.
(No credit card required)
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.