I have a .NET Compact Framework (CF) application on Windows CE that interacts with native some DLL files, and the application has some unknown behaviors and problems.
For now, I'm using direct calls by using the [DllImport] attribute and define a method:
[DllImport("mynative.dll")]
private static extern void HelloWorld(byte[] arrName);
I want to try to release the loaded libraries, and web researches showed me LoadLibrary
and FreeLibrary
. How can I find a tutorial or sample code?
Stack Overflow question How to dynamically load and unload a native DLL file? is a desktop sample, but how can it done for Compact Framework? Note that .NET Compact Framework does not have 'Marshal.GetFunctionPointerForDelegate' method.