You can do this in .NET 2.0. What you would do is create a delegate
with the appropriate signature. Once you have that, you would call
LoadLibrary and GetProcAddress (through the P/Invoke layer) to get the
address of the function.
Finally, you would call the static GetDelegateForFunctionPointer method
on the Marshal class to get a delegate that represents the function in the
unmanaged dll you loaded.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
<wa********@yahoo.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I know how to use [DLLImport] when I know the path the DLL I'll be
importing. But I have the following scenario:
I have a series of DLL plugins that all have the exact same function
signatures just different implementations of them.
I'd like to programatically search a directory for them and import them
some how. Even though I know there signatures at compile time I won't
know the DLL file names till run time.
Any ideas how to do this?
Thanks very much.