Answer the question
In order to leave comments, you need to log in
Is it possible to put the path to the included dll into some external file?
In the VB.net project, I include the dll like this:
<DllImport("dll.dll",
EntryPoint:="Test",
SetLastError:=True,
CharSet:=CharSet.Ansi,
ExactSpelling:=True,
CallingConvention:=CallingConvention.Cdecl
)>
Answer the question
In order to leave comments, you need to log in
An unmanaged dll can be loaded dynamically via LoadLibrary by specifying the path to it.
The order is something like this:
1. LoadLibrary with the path to the dll.
2. GetProcAddress gets an unmanaged function pointer in the dll.
3. Marshal.GetDelegateForFunctionPointer converts an unmanaged function pointer into a delegate that can be used in the usual C# way.
4. FreeLibrary exits the dll.
More details and with an example
Well, you need to work with managed ones through the Assembly class.
For example, loading an assembly is Assembly.LoadFrom(string)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question