C++ 例:
WIN32PROJECT1_API void test8(RECT &a) {
a.left = 1;
a.top = 2;
a.right = 3;
a.bottom = 4;
}
此时参数为 RECT &a,在Delphi中有两种申明方式,各有不同
- 1、方式一var
procedure test8(var a: TRect); cdecl; external Windll name 'test8';
- 2、方式const
procedure test8(const a: TRect); cdecl; external Windll name 'test8';
**小知识:C++中以&的参数在Delphi必须以const或者var申明,否则会产生错误,这也是我亲试的结果。 **