DLL Load issue

This is a discussion on DLL Load issue within the Windows Programming forums, part of the Platform Specific Boards category; Hello everyone, I am developing a DLL and I implement a class in the DLL. I am wondering in the ...

  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
    1,591
    >> 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.
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

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, 07: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, 04:29 AM
  5. load MMC snap in dll
    By rohit in forum Windows Programming
    Replies: 1
    Last Post: 02-21-2002, 10:51 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21