MAMEWorld >> Programming
View all threads Index   Flat Mode Flat  

Anonymous
Unregistered
Re: .Net Question, How to reference a dll with different names
01/28/07 11:16 PM


> I am using a library that wraps a "dll". On Windows the dll goes by one name, on
> other OS's it goes by another. Currently, there is a compile time #if that sets a
> const string to the dll name and another const variable. This results in distributing
> 2 copies of the library, one for Windows users and one for other OS's.
>
> Does anyone have recommendations on how I could implement a way that initializes
> everything after determining the OS version at runtime?

I've used dllimports under windows & windows ce where this often happens. You create two functions with different names and specify an entry point ( because the entry point is often the same in the two dll's ). From then on you can either use an if check on every call as dot net is helpful and will only try to open the dll when the code actually is called, the alternative is to use a delegate ( though this only works if the two functions take identical pointers ).

I don't have any code to hand, but I can dig something out if you need it.

smf

Edited by smf (01/28/07 11:16 PM)







Entire thread
Subject Posted by Posted on
* .Net Question, How to reference a dll with different names 2600 01/26/07 11:31 PM
. * Re: .Net Question, How to reference a dll with different names alpa  03/06/07 12:24 PM
. * Re: .Net Question, How to reference a dll with different names twistyAdministrator  03/06/07 03:51 PM
. * Re: .Net Question, How to reference a dll with different names Anonymous  01/28/07 11:16 PM
. * Re: .Net Question, How to reference a dll with different names 2600  01/29/07 07:32 PM
. * Re: .Net Question, How to reference a dll with different names Anonymous  02/28/07 05:22 PM
. * Re: .Net Question, How to reference a dll with different names Anonymous  02/03/07 10:08 AM
. * Re: .Net Question, How to reference a dll with different names kkd  02/14/07 07:25 PM
. * Re: .Net Question, How to reference a dll with different names Anonymous  02/14/07 09:42 PM
. * Re: .Net Question, How to reference a dll with different names kkd  02/15/07 12:01 AM
. * Re: .Net Question, How to reference a dll with different names Anonymous  02/16/07 06:28 AM

Extra information Permissions
Moderator:  Pi 
0 registered and 41 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 4880