Loading Multiple Instances of DLL

  • Thread starter Thread starter Michael Hesse
  • Start date Start date
M

Michael Hesse

Hi,

I need to use two versions of the same DLL in a VB.Net application. I know
how to load one version:

Public Declare Function DoSomething Lib "MyDLL.Dll" () As Double

However if I try to also load:

Public Declare Function DoSomething Lib "MyOtherDLL.Dll" () As Double

I end up with 2 functions with the same name.

How do I get around this?

Thanks,

Michael
 
Michael,
I need to use two versions of the same DLL in a VB.Net application. I know
how to load one version:

Public Declare Function DoSomething Lib "MyDLL.Dll" () As Double

However if I try to also load:

Public Declare Function DoSomething Lib "MyOtherDLL.Dll" () As Double

I end up with 2 functions with the same name.

How do I get around this?

Put the Declare statements in two different classes, or use the Alias
clause to separate them

Public Declare Function Foo Lib "MyDLL.Dll" Alias "DoSomething" () As
Double

Public Declare Function Bar Lib "MyOtherDLL.Dll" Alias "DoSomething"
() As Double


Mattias
 
Back
Top