Or, I see... Why using this?
#region Delegates to Exported Functions
#endregion
I mean, why writing the delegate definition inside this region??? It won't do anything. Please see below.
By the way, invalid keyword keyword
#endreg
shows the text you provide is not a real code, just some text which will not compile... If you did not take an effort to present your problem correctly, how can you hope others will use their valuable free time to help you?..
Anyway, here is what I suspect: looking at your delegate clause I think you failed to link any DLL exported code at all. First, you do not need this delegate. You need C# declaration with
DLLImport
attribute (see
System.Runtime.InteropServices.DllImportAttribute
).
As to your delegate, you don't need any. This is merely a type declaration with no reference to any real code.
Dump your unmanaged DLL, check up exact name of the function, use explicit
DllName
parameter of the
DLLImport
attribute, check up all calling conventions.
If it does not work, present your code, C export file and function profile
accurately and report here -- will work.