Loading Multiple Instances of DLL

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
 
M

Mattias Sjögren

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top