By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,504 Members | 1,194 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,504 IT Pros & Developers. It's quick & easy.

Loading muliple instances of a DLL

P: n/a
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
Oct 8 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Oct 8, 3:26 pm, "Michael Hesse" <mhe...@sbcglobal.netwrote:
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,
--
Tom Shelton

Oct 9 '07 #2

P: n/a
Thanks. That's what I was looking for.

Michael

"Tom Shelton" <to*********@comcast.netwrote in message
news:11**********************@22g2000hsm.googlegro ups.com...
On Oct 8, 3:26 pm, "Michael Hesse" <mhe...@sbcglobal.netwrote:
>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,
--
Tom Shelton

Oct 9 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.