Loading muliple instances of a 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
 
T

Tom Shelton

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

This is an appropriate place to use the Alias keyword...

Public Delcare Function DoSomething1 Lib "MyDll.Dll" Alias
"DoSomething" ()

Public Declare Function DoSomething2 Lib "MyOtherDll.Dll" Alias
"DoSomething" ()

HTH,
 
M

Michael Hesse

Thanks. That's what I was looking for.

Michael

Tom Shelton said:
This is an appropriate place to use the Alias keyword...

Public Delcare Function DoSomething1 Lib "MyDll.Dll" Alias
"DoSomething" ()

Public Declare Function DoSomething2 Lib "MyOtherDll.Dll" Alias
"DoSomething" ()

HTH,
 

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