Hi,
I am new to Delphi, so sorry if this is a 'newbie' question
... pointers just confuse me at the moment.
I have a proc, that passes an array of pointers, and I cannot figure out how to pass back a string, and I've tried the following but it wont compile.
type
TPCharArray = array[0..12] of PChar;
function ReadFileToArray(argc: ShortInt; var argv: TPCharArray): integer; stdcall; export;
var strRob : String;
Begin
strRob := 'robdon'#0;
argv[3] := Pchar(strRob);
End;
If I change the code to
argv[3] := 'robdon'#0;
It works fine, but I want to pass back a variable, that has a string in it.
I cant change the parameters to the proc, cause its a DLL that is called by a 3rd party app.
Thanks for any help,
Rob Donovan.
ProIV Resource Centre
I am new to Delphi, so sorry if this is a 'newbie' question
I have a proc, that passes an array of pointers, and I cannot figure out how to pass back a string, and I've tried the following but it wont compile.
type
TPCharArray = array[0..12] of PChar;
function ReadFileToArray(argc: ShortInt; var argv: TPCharArray): integer; stdcall; export;
var strRob : String;
Begin
strRob := 'robdon'#0;
argv[3] := Pchar(strRob);
End;
If I change the code to
argv[3] := 'robdon'#0;
It works fine, but I want to pass back a variable, that has a string in it.
I cant change the parameters to the proc, cause its a DLL that is called by a 3rd party app.
Thanks for any help,
Rob Donovan.
ProIV Resource Centre