例如 [DllImport("test.dll")] public static extern int f1();
[DllImport("xxx.dll")] public static extern int f1(); [DllImport("xxx.dll")] public static extern int f2();之後直接用 f1() 或 f2() 呼叫就可以了,如果不行,一定是你 C++ 有寫錯,例如沒有導出。
那 "xxx.dll"应该放在什么路径下? 直接写[DllImport("xxx.dll")],提示:unable to load dll ,找不到指定模块
http://msdn.microsoft.com/zh-cn/library/ms173183(VS.80).aspx
看了DllImport,也没弄清楚。才来问问。
[DllImport("test.dll")]
public static extern int f1();
[DllImport("xxx.dll")]
public static extern int f1();
[DllImport("xxx.dll")]
public static extern int f2();之後直接用 f1() 或 f2() 呼叫就可以了,如果不行,一定是你 C++ 有寫錯,例如沒有導出。
那 "xxx.dll"应该放在什么路径下?
直接写[DllImport("xxx.dll")],提示:unable to load dll ,找不到指定模块
/// 停止当前任务
/// </summary>
/// <returns></returns>
[DllImportAttribute("AudioEditor.dll", EntryPoint = "AEStop", CallingConvention = CallingConvention.StdCall)]
public static extern int AEStop();EntryPoint: 指定要调用的 DLL 入口点。默认入口点名称是托管方法的名称 。
CallingConvention指示入口点的函数调用约定(默认WINAPI)