Dynamic Invoke from Unmanaged DLL (CompactFramework, WjnCE.NET 5, vs 2003, C#)

M

Marco [Stinger]

Hi
Sorry if this has been asked before but I'm VERY new to the
compact framework.

Here's my problem
I'm writing a program for a WinCE.NET 5 device using Visual Studio 2003
and C#.
This program needs to call a few DLL writen in EmbeddedC++.
I already know that the dll's work since I've tested them with

[DllImport("Name of the Dll")]
extern static int NameOfTheDllFunction( ...parameters ... );

Unfotunately NOT all the DLLs will be installed (they work like plugins).
So I need to choose dynamically the name(s) of the dll I will be calling.
THe idea is that my app must not know the name of the DLLs
All DLLs have the same functions with the same parameters and return type.

I searched the net for some answers but I'm having a hard time.
Look at

www.codeprojects.com/useritems/dynamicinvokedll.asp

That seems like a solution (even thou I think I need to do something
SIMPLER)
but the namespace System.Reflection.Emit seems to be missing from the
compact framework

Any help will be highly appreciated (free coffee if you come to Milan ;) )

Ciao
Marco
 
W

Wiktor Zychla

Here's my problem
I'm writing a program for a WinCE.NET 5 device using Visual Studio 2003
and C#.
This program needs to call a few DLL writen in EmbeddedC++.
I already know that the dll's work since I've tested them with

[DllImport("Name of the Dll")]
extern static int NameOfTheDllFunction( ...parameters ... );

Unfotunately NOT all the DLLs will be installed (they work like plugins).
So I need to choose dynamically the name(s) of the dll I will be calling.
THe idea is that my app must not know the name of the DLLs
All DLLs have the same functions with the same parameters and return type.

I suggest you write your own unmanaged library that exposes a method for
dynamic calls. This method should use LoadLibrary/GetProcAddress. look for
examples at:

http://www.bearcanyon.com/dotnet/#getprocaddress

http://www.codeproject.com/csharp/dyninvok.asp?df=100&forumid=2892&exp=0&select=838412

Wiktor Zychla
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top