Board index » delphi » Pls Help interface from C/C++ to DLL created in Delphi
David Patrick
![]() Delphi Developer |
Fri, 02 Nov 2001 03:00:00 GMT
Pls Help interface from C/C++ to DLL created in Delphi
I have to interface to a DLL created in Delphi and I am running into all
types of problems. For example .. 1) How is a delphi array organized ? If I have a function in delphi .. procedure SayIt3( N : array of integer ); stdcall; and in "C" I have typedef void (_stdcall *FP_SAYIT3) (int *); The output is Hello from SayIt3 I assume ia[0] is used as the array length indicator .. .. but in that case 2) I know that delphi shortstring values are byte arrays where the first ie This routine works fine as far as cleaning up the stack ... procedure SayIt( N : shortstring ); stdcall; but this routine causes 4 bytes too many to be popped off on the "ret" procedure SayIt( var N : shortstring ); stdcall; for both versions I using the following in "C" typedef void (_stdcall *FP_SAYIT)(void *); char p[256]; strcpy( &(p[1]),"Hello David..." ); Actually, I should also mention that for the routine from question #1, in Any Help is most appreciated ... Thanks .. Dave |