Thread: DLL Load issue

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    1,579

    DLL Load issue

    Hello everyone,


    I am developing a DLL and I implement a class in the DLL. I am wondering in the two situations,

    1. DLL is loaded by a single process multiple times

    2. DLL is loaded a couple of times by multiple process

    How much times will the constructor be invoked? I want to learn how objects inside a DLL is shared between different process. Is it possible to make multiple process share one single class (class is defined in DLL) object instance?


    thanks in advance,
    George

  2. #2
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    A normal program doesn't load a DLL multiple times. When you call LoadLibrary on the same DLL two times, it doesn't load it again on the second time, it just gives you the handle of the current one (and increments the load counter). Only LoadLibrary, FreeLibrary, LoadLibrary, FreeLibrary would result loading and unloading the DLL two times.
    "The Internet treats censorship as damage and routes around it." - John Gilmore

  3. #3
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    >> Is it possible to make multiple process share one single class (class is defined in DLL) object instance?

    No, each process that loads a DLL has it's own seperate memory spaces for it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. non-MFC DLL with MFC app question.
    By Kempelen in forum Windows Programming
    Replies: 10
    Last Post: 08-20-2008, 07:11 AM
  2. dll issue
    By axr0284 in forum C++ Programming
    Replies: 1
    Last Post: 03-23-2006, 08:37 AM
  3. dll communicating between each other
    By cloudy in forum C++ Programming
    Replies: 5
    Last Post: 06-17-2005, 02:20 AM
  4. .lib vs .h vs .dll
    By Shadow12345 in forum C++ Programming
    Replies: 13
    Last Post: 01-01-2003, 05:29 AM
  5. load MMC snap in dll
    By rohit in forum Windows Programming
    Replies: 1
    Last Post: 02-21-2002, 11:51 PM