3
我需要从C#应用程序调用VC++ dll的回调函数。以下是VC++中的回调函数。从C#调用VC++ dll的回调函数#
INT_PTR CALLBACK My_Proc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
. . . . .
}
我已经导入了dll,但我不知道如何从C#调用函数。有什么想法吗?
public class testClass
{
internal static class UnsafeNativeMethods
{
const string _dllLocation = "test.dll";
[DllImport(_dllLocation, CallingConvention = CallingConvention.Cdecl)]
public static extern int My_Proc(int value1, int value2, Int64 value3, int value4);// am getting stuck here
}
}
,什么是问题???另外'Int64'似乎是错误的。 – leppie 2012-02-08 08:44:32