473,405 Members | 2,141 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Loading muliple instances of a DLL

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
2 1108
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Angelos Karantzalis | last post by:
Hi y'all, here's a tricky one: I've written a wrapper around a Com Interop-generated assembly in C#. It's called SDEHandler & implements a previously defined interface, so that I can use it as a...
1
by: Bill K | last post by:
I am developing a winforms project in vb.net. I have several forms that have a number of controls, grids, etc. When I load these as MDI child forms, they load slowly AND they paint/repaint on the...
17
by: Aguilar, James | last post by:
My previous example used the concept of a Shape class heirarchy, so I will continue with that. Suppose I have something like fifty different shapes, and I am trying to instantiate one of them. ...
4
by: Barry Kelly | last post by:
I'm designing an application framework which will, amongst other things, live in an assembly hosted in the ASP.NET worker process, servicing webservice requests. Here's the scenario: APPFX is...
1
by: Bart Lynn | last post by:
Is it possible, to have 3 forms, (Form1, Form2 and Form3) that based on user input, loads the select form as a particular varaible name? Here is what I mean I want the loaded form to be...
2
by: ZaX | last post by:
Good day folks, I'm working with a third-party transactionnal SDK, packaged into a few DLL. In a particular scenario, I need to have two sessions opened on the infrastructure I access thru the...
1
by: Richard Deakin | last post by:
Hi I'm having problems loading a new instance of SQL 2000 Developer edition as a default instance onto my laptop. Everytime I try to do so it I get a message at the end of the installation...
6
by: ernesto.tejeda | last post by:
Hello, I have a couple of questions regarding the loading of .js files for the browser and would like anyone to point me wher to find the answer (or if you know the answer and tell me will do just...
2
by: wzhao2000 | last post by:
Back in COM time, it's possible to use #import statement in cpp to load COM object type info and use it at coding time. When the application is started, the underlying COM DLL will not be loaded...
9
by: Scott Cupstid | last post by:
Ok, here it is. Which is more correct? AList = New ArrayList for i = 0 to 10 A = New myObject AList.Add(A) A = nothing next
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.