Results 1 to 2 of 2

Thread: dll instnaces

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2002
    Posts
    4

    dll instnaces

    Hi

    I want to know the no of instances running for a dll.

    Thanks in advance

  2. #2
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796

    Smile Instances

    Have a general module in your DLL with a global variable. Increment it everytime your class initializes and decrement it every time your class terminates.

    e.g.
    Code:
    Private Sub Class_Initialize()
       gintInstanceCount = gintInstanceCount + 1
    End Sub
    
    Private Sub Class_Terminate()
       gintInstanceCount = gintInstanceCount - 1
    End Sub
    NOTE:
    All instances of a DLL class instantiated in the same thread will share global variables (Make sure you have a thread pool of one and not one thread per object).
    Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width