Loading muliple instances of a 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
 
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,
 
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,
 
Back
Top