Ideas to count instances of VB servers, DLLs, or OCXs in memory and running? 
Author Message
 Ideas to count instances of VB servers, DLLs, or OCXs in memory and running?

any ideas how to count instances?


Sat, 04 Aug 2001 03:00:00 GMT  
 Ideas to count instances of VB servers, DLLs, or OCXs in memory and running?
Global variable in the class_initialize should do the trick.  Put the global
variable in a module and then increment it in the class initialize method.
I don't like how this works as VB doesnt really support what C++ and other
OO languages have Class methods and instance methods as far as I can tell.
In other languages there is only one Class Method and you don't need object
reference to access it.  There are N instance methods and you need an object
reference to reference them.

If this is wrong someone straighten me out.

P.S. I stumbled accross the global public variable when some code I had
didn't work the way I thought it should.

Quote:

>any ideas how to count instances?



Sun, 05 Aug 2001 03:00:00 GMT  
 Ideas to count instances of VB servers, DLLs, or OCXs in memory and running?
Gene,

Remember that global variables are global to a thread. Each client of an
ActiveX EXE will be connected to a different thread which will have a
different set of global variables.

Matthew



Quote:
> Global variable in the class_initialize should do the trick.  Put the
global
> variable in a module and then increment it in the class initialize
method.
> I don't like how this works as VB doesnt really support what C++ and
other
> OO languages have Class methods and instance methods as far as I can
tell.
> In other languages there is only one Class Method and you don't need
object
> reference to access it.  There are N instance methods and you need an
object
> reference to reference them.

> If this is wrong someone straighten me out.

> P.S. I stumbled accross the global public variable when some code I had
> didn't work the way I thought it should.

> >any ideas how to count instances?



Mon, 06 Aug 2001 03:00:00 GMT  
 Ideas to count instances of VB servers, DLLs, or OCXs in memory and running?
True enough but put it in a DLL as I did


Quote:
>Gene,

>Remember that global variables are global to a thread. Each client of an
>ActiveX EXE will be connected to a different thread which will have a
>different set of global variables.

>Matthew



>> Global variable in the class_initialize should do the trick.  Put the
>global
>> variable in a module and then increment it in the class initialize
>method.
>> I don't like how this works as VB doesnt really support what C++ and
>other
>> OO languages have Class methods and instance methods as far as I can
>tell.
>> In other languages there is only one Class Method and you don't need
>object
>> reference to access it.  There are N instance methods and you need an
>object
>> reference to reference them.

>> If this is wrong someone straighten me out.

>> P.S. I stumbled accross the global public variable when some code I had
>> didn't work the way I thought it should.

>> >any ideas how to count instances?



Mon, 06 Aug 2001 03:00:00 GMT  
 Ideas to count instances of VB servers, DLLs, or OCXs in memory and running?
Mathew

This is true for class modules, but variables declared as "Public" or
"Global" in a standard code module are shared throughout the ActiveX
Exe or DLL - all instances of classes and forms can read and update the
same variable, for instance, a database connection object, an integer
variable, or an instance of a form.

--
Peter

(Please reply to the newsgroup if possible)



Tue, 07 Aug 2001 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. One instance of VB Application run in the memory

2. DLLs and OCXs needed to run a vb6 exe other than vb6rundll

3. Upgarding DLLs and OCXs with App running

4. API Memory Problems running multiple reports from VB using crpe32.dll

5. VB 6.0 and IE 6.0 system OCXs and DLLs incompatibilities

6. Using VB DLLs OCXs with VC

7. Multiple Instance of a VB32 App running on Win NT 4.0 Server

8. Can't run two instance of sample application on NT server, Help

9. Can't run two instance of sample application on NT server, Help

10. Can't run two instance of sample application on NT server, Help

11. Cannot run multiple instances of a DLL under WIN32s

12. running dll as http://server/dll?parameter

 

 
Powered by phpBB® Forum Software