且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从Delphi应用程序调用C ++编写的dll

更新时间:2023-02-07 19:19:21

我知道关于Delphi没什么,但是您确定它可以处理参考参数吗?我经常使用的其他语言(Java,Python)都无法处理C ++引用,因此对于Delphi来说可能是相同的,这就是导致问题的原因.

干杯,

I know nothing about Delphi but are you sure it can cope with a reference parameter? None of the other languages I use regularly (Java, Python) can handle C++ references so it might be same for Delphi and that''s what''s causing the problem.

Cheers,

Ash


1. C ++中的字符串= Deplhi中的PChar.
2. extern "C"表示C样式的函数调用.对于delphi,我记得它是cdecl.

干杯
1. String in C++ = PChar in Deplhi.
2. extern "C" means C-style function calling. For delphi it is cdecl as soon as I remember.

Cheers


检查了C ++和Delphi代码.什么都没看到:(但这看起来有点有趣:
Hi, checked both C++ and Delphi code. Don''t see anything :( However this looks a little bit interesting:
extern "C" __declspec(dllexport) int getName(int index, char* &name)



C ++中是否存在诸如* &说明符之类的东西?不应该是



Is there such thing as * & specifier in C++? Shouldn''t it be

extern "C" __declspec(dllexport) int getName(int index, char* name)



?



?