Solved

How to create a persistable activex dll?

Posted on 2002-06-24
5
402 Views
Last Modified: 2007-12-19
I need to implement a database in memory on the server using VB dll, and acces it on the clients through COM+.

I've created a simple ActiveX dll, added a module with a public variable, and added a class with a get and set public functions.

Then I registered the dll into the components, application settings: server appl. and leave running when idle. If I use multiple instances of the components on the clients, they use own variables, and not share the same one.

I've coded the same in C++/Atl with a global variable, and worked.

How to make a gocal variable in VB dll (I mean the var is global for the class instances)???

0
Comment
Question by:cosie
5 Comments
 

Expert Comment

by:mudasir_ahmed
Comment Utility
Hi Cosie,
 Set the class properties to 5-Multiple Instancing.

-Mudasir.
0
 

Author Comment

by:cosie
Comment Utility
I've tried it, but didn't work.
0
 
LVL 10

Accepted Solution

by:
GoodJun earned 500 total points
Comment Utility
Cosie,
the public variables defined in standart modules aren't really global variables. These public variables are scoped at the STA level rather than at the process level. so only read-only public variables should be in the standard module.

The COM+ Services Type Library has a component Shared Property Manager (SPM). It has the locking scheme to synchronize access to public data. I believe SPM is the solution (I havn't done one yet)
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
Hi cosie,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept GoodJun's comment(s) as an answer.

cosie, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 5

Expert Comment

by:Netminder
Comment Utility
Per recommendation, force-accepted.

Netminder
EE Admin
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

763 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

12 Experts available now in Live!

Get 1:1 Help Now