Results 1 to 2 of 2

Thread: Want seperate set of global variables for each instance of DLL

  1. #1

    Thread Starter
    Hyperactive Member Utpal's Avatar
    Join Date
    Feb 2002
    Location
    Mumbai, India
    Posts
    393

    Want seperate set of global variables for each instance of DLL

    Hi everybody,
    I have made a DLL which makes use of Global variables declared in a standard module. When a single instance of the DLL is run, there is no problem, but when I start a second instance, the Global variables are shared between the 2 instances. But this is not what I want to happen. I want to have a seperate set of variables for each instance that is global only within that instance and are not accessible by other instances. Is that possible? The reason I need to use global variables is because I am using the same variables (common) in my class module, standard module as well as in forms in that DLL. I am allowing access to the global variables through properties in the class module and those variables are used in forms and in procedures in the standard module.
    It is easy when you know it.

  2. #2
    Frenzied Member yrwyddfa's Avatar
    Join Date
    Aug 2001
    Location
    England
    Posts
    1,253
    The reason you find that data is shared is an accident of thread local storage.

    If you need to share data across instances, threads, processes, or machines you should use a process dedicated to that task

    That process is called a database.

    VB is highly optimised when talking to OLE DB sources (such as ADO/SQL Server)

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