PInvoking dll's

  • Thread starter Thread starter Saurabh Chawla
  • Start date Start date
S

Saurabh Chawla

Hi,
I have got 2 dll's , one compiled for ppc 2002 and another for ppc
2003.
Now , both have got same export function Func().
In my application, i want to pinvoke dll's based on the value provided
by System.Environment.OSVersion.Platform which gives me either PPC2002
or PPC2003.
I am not finding any solution to this problem.
Can anyone give me suggestions.

Thanks
Saurabh
 
Hi Saurabh,

The simplest solution will be defining two imports with different function
names and same aliases and calling appropriate function based on platform
value.

[DllImport("yourdll02.dll", EntryPoint="Func")]
private static extern void Func2002();

[DllImport("yourdll03.dll", EntryPoint="Func")]
private static extern void Func2003();

Using EntryPoint you can use different names for your dll functions.

Thanks

Ercan Turkarslan
Microsoft Mobile Devices Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top