W wangxz79 Unregistered / Unconfirmed GUEST, unregistred user! 2005-07-11 #1 Delphi中MyTest.dll导出<br>function MyTest: PChar;stdcall;<br>在VBA中调用形式为<br>declare MyTest "MyTest.dll" () as string<br>怎么有时候VBA中调用返回值有问题
Delphi中MyTest.dll导出<br>function MyTest: PChar;stdcall;<br>在VBA中调用形式为<br>declare MyTest "MyTest.dll" () as string<br>怎么有时候VBA中调用返回值有问题
W wangxz79 Unregistered / Unconfirmed GUEST, unregistred user! 2005-07-11 #2 Delphi中MyTest.dll导出<br>function MyTest: PChar;stdcall;<br>在VBA中调用形式为<br>declare MyTest "MyTest.dll" () as string<br>怎么有时候VBA中调用返回值有问题
Delphi中MyTest.dll导出<br>function MyTest: PChar;stdcall;<br>在VBA中调用形式为<br>declare MyTest "MyTest.dll" () as string<br>怎么有时候VBA中调用返回值有问题
D duhai_lee Unregistered / Unconfirmed GUEST, unregistred user! 2005-07-11 #3 pchar 和string 不是一回事, 你最好在vb中用安全的方式获得。 或者把delphi的MyTest方法返回值改为 string, 在library的第一个uses中写上sharemem 。
K kkyy Unregistered / Unconfirmed GUEST, unregistred user! 2005-07-11 #5 喔,这种函数返回之前最好在DLL内分配全局空间,返回空间指针,
5 5411 Unregistered / Unconfirmed GUEST, unregistred user! 2005-07-11 #6 function MyTest(sReturn: Pchar): boolean;stdcall;<br>在VBA中调用形式为<br>declare MyTest "MyTest.dll" (sReturn: string) as long
function MyTest(sReturn: Pchar): boolean;stdcall;<br>在VBA中调用形式为<br>declare MyTest "MyTest.dll" (sReturn: string) as long
W wangxz79 Unregistered / Unconfirmed GUEST, unregistred user! 2005-07-11 #7 各位大侠,还是有问题,现在我要从Delphi的Dll返回一字符串到VBA,帮帮忙
G gooodlife Unregistered / Unconfirmed GUEST, unregistred user! 2005-07-11 #8 怎么有时候VBA中调用返回值有问题<br><br>从你这句话大概可以看出。接口声明和 VBA中调用都应该是没有问题的吧.<br>如果有问题我觉的不会取得正确的返回值吧..<br><br>是不是你的DLL计算代码有问题呢?
怎么有时候VBA中调用返回值有问题<br><br>从你这句话大概可以看出。接口声明和 VBA中调用都应该是没有问题的吧.<br>如果有问题我觉的不会取得正确的返回值吧..<br><br>是不是你的DLL计算代码有问题呢?
W wangxz79 Unregistered / Unconfirmed GUEST, unregistred user! 2005-07-11 #9 问题解决了<br>Delphi返回的Result := StrNew()才行