随笔分类 - VC++
摘要:两个错误:1. Run-Time Check Failure #0 - The value of ESP was not properly saved across afunction call. This is usually a result of calling a function declared with onecalling convention with a function pointer declared with a different calling convention 先把dll的项目属性中C/C++->Code Generation->Basic Ru
阅读全文
摘要:1. 首先,在Visual Studio中,我们建立一个Visual C++的项目 类型选择Win32 Project,继续选择Dll类型 该项目取名叫做myDll 1) 添加myDll.h头文件,代码如下:#ifdefA_EXPORTS#defineDLL_API__declspec(dllexport)#else#defineDLL_API__declspec(dllimport)#endifextern"C"DLL_APIvoidHelloWorld(); 这里HelloWorld()就是等下我们要暴露给C#调用的C方法。 注意:必须给函数增加extern "
阅读全文