【发布时间】:2011-10-17 13:12:35
【问题描述】:
我有 Delphi 2010 用两种方法构建的 DLL:
function Foo1(a, b: Integer):PChar; export; stdcall;
function Foo2(a, b, c:Integer):PChar; export; stdcall;
exports Foo1, Foo2;
他们每个人都返回Result := PChar('Test')。
我的 C++\CLI 代码
在标题中
typedef const wchar_t* (*pFUNC1)(int a, int b);
pFUNC1 TestFoo1;
typedef const wchar_t* (*pFUNC2)(int a, int b, int c);
pFUNC2 TestFoo2;
由LoadLibrary 和GetProcAddress 函数初始化。
用法:TestFoo1(0,0)和TestFoo2(0,0,0);
两者都在发布模式下工作。
但在调试模式下,Foo2 正在中止。
请指教出了什么问题。
【问题讨论】:
标签: delphi c++-cli delphi-2010