Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 399
  • Last Modified:

Newbie Question - VB6 GetObject in .net

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

Graham
0
GillyTheTaffy
Asked:
GillyTheTaffy
  • 3
  • 3
1 Solution
 
DonRameshSachinCommented:
HI,
 In .NET there is no concept of ActiveX Exe or ActiveX DLL. Probably u can use Class library project (.DLL) to achieve ur requirement.

Don
0
 
GillyTheTaffyAuthor Commented:
Actually found what I was looking for - the Shared keyword for variables was exactly what I was looking for

cheers anyway
0
 
DonRameshSachinCommented:
Hi,
 basically,
 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.

Don
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
GillyTheTaffyAuthor Commented:
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

Graham
0
 
GillyTheTaffyAuthor Commented:
Dan,

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.
0
 
DonRameshSachinCommented:
Hi
I feel the best way is to use class and shared variables/methods rather going for a standard exe.
Shared variables/ methods will be initialized only once and will available through out ur application.

Don
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now