-- Reddy Palle.
"Peter Falkesand" <pe...@datavara.se>
> Hi, i need to convert a edit1.text (TCaption) to an PWideChar , how do i
> do??
>
> I have a DLL that want's a PWideChar as a parameter, which is a path to a
> file, so how do i convert a path i have in a edit field into an pWideChar
??
>
I have a DLL that want's a PWideChar as a parameter, which is a path to a
file, so how do i convert a path i have in a edit field into an pWideChar ??
Rgrds, Peter
Could you show me an small example ??
Rgrds, Peter
"Reddy Palle" <reddyp@> skrev i meddelandet news:3d5917a1@dnews...
function TestWideString(const S: string): Boolean;
var
PW: PWideChar;
Len: Integer;
begin
Len := 2 * (Length(S) + 1);
PW := AllocMem(Len);
try
StringToWideChar(S, PW, Len);
{ Your function Call }
finally
FreeMem(PW);
end;
end;
-- Reddy Palle
I think you can just use a wide string like:
var
WideSt: WideString;
pWideCh: PWideChar;
begin
Wide:=Edit1.Text;
pWideCh:=@WideSt[1];
CallProcWithPWideChar(pWideCh);
Andy.
var
WideSt: WideString;
pWideCh: PWideChar;
begin
WideSt:=Edit1.Text;
pWideCh:=@WideSt[1];
CallProcWithPWideChar(pWideCh);
pch := PWideChar(edit1.text);