Solved

Newbie Question - VB6 GetObject in .net

Posted on 2004-03-31
6
363 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
[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
  • 3
6 Comments
 
LVL 2

Expert Comment

by:DonRameshSachin
ID: 10729626
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
ID: 10729632
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
ID: 10729669
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
Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

 
LVL 1

Author Comment

by:GillyTheTaffy
ID: 10729734
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
ID: 10736853
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
ID: 10738752
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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

726 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