Dear all,
This is my problem:
I need to integrate a DLL named test.dll and created in LV 6.1 into a Delphi v.6 program.
This DLL contains a function declared as this:
int32 __cdecl test(int32 CodeProduct, char DataRead[], int32 DataLength);
The parameters are these ones:
- CodeProduct: 32-bit integer.
- DataRead: C String Pointer with DataLength bytes. Returns the read alphanumeric string.
- DataLength: Length of DataRead. 32-bit integer.
- Function returns an error code (32-bit integer). It is declared as cdecl (C Convention Call).
In Delphi 6 the function is declared as follows:
function test(CodeProduct : Integer;var DataRead : Pchar;DataLength : Integer):Integer;cdecl;external 'test.d
ll' name 'test';
The function loads well into the Delphi Program, but when it is called, the program hangs up. Debug is not possible, because it looks that the problem lies in the conversion of Delphi type PChar to LabView type Cstring. There is not any problem with the integer type. He have tried with Pascal strings, array of bytes, array of char, stdcall or cdecl, but it does not work.
Any ideas?
The dll is attached to this message.
Thanks.