Load two instances of the same DLL in Delphi

Posted by Tom on Stack Overflow See other posts from Stack Overflow or by Tom
Published on 2010-04-20T13:40:33Z Indexed on 2012/06/22 21:16 UTC
Read the original article Hit count: 175

Filed under:
|
|

Here's my problem: I would like to create two separate instances of the same DLL.

The following doesn't work because Handle1 and Handle2 will get the same address

  Handle1 := LoadLibrary('mydll.dll');
  Handle2 := LoadLibrary('mydll.dll');

The following works, but I have to make a copy of the DLL and rename it to something else (which seems a bit silly)

  Handle1 := LoadLibrary('mydll.dll');
  Handle2 := LoadLibrary('mydll2.dll');

Is there a way to have only one DLL file, but load several instances of it?

© Stack Overflow or respective owner

Related posts about delphi

Related posts about dll