Calling an embedded unmanaged dll
C#
1
Posts
1
Posters
0
Views
1
Watching
-
I have a dll written in unmanaged c++ that I need to call. Currently, it is embedded inside the main assembly as an resource, and is extracted when it needs to be called. This call is done by using DllImport, for example:
\[DllImport("CppImplementation.dll")\] public unsafe static extern bool AreEqual(byte\* lhs, byte\* rhs, int len);
Is there any way to tell DllImport to look inside the main assembly's resources, so that it is not necessary to extract the unmanaged assembly into a file before calling? Or is there some other efficient method to call these unmanaged functions?