Solved

Newbie Question - VB6 GetObject in .net

Posted on 2004-03-31
6
338 Views
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

Graham
0
Comment
Question by:GillyTheTaffy
  • 3
  • 3
6 Comments
 
LVL 2

Expert Comment

by:DonRameshSachin
Comment Utility
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
 
LVL 1

Author Comment

by:GillyTheTaffy
Comment Utility
Actually found what I was looking for - the Shared keyword for variables was exactly what I was looking for

cheers anyway
0
 
LVL 2

Expert Comment

by:DonRameshSachin
Comment Utility
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 1

Author Comment

by:GillyTheTaffy
Comment Utility
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
 
LVL 1

Author Comment

by:GillyTheTaffy
Comment Utility
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
 
LVL 2

Accepted Solution

by:
DonRameshSachin earned 50 total points
Comment Utility
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

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now