On Nov 17, 2007 1:25 PM, Marc Weustink <[EMAIL PROTECTED]> wrote:
> First question, why is the copying needed ?
> Why isn'tlpStrFile := PWChar(FileNameWide);
> simply enough ?
>
> IMO, you're copying way to much.
That variable is only valid on the scope of the function, and we need
something m
Felipe Monteiro de Carvalho wrote:
Hello,
In a LCL code we have:
var
FileNameBuffer: PChar;
FileNameWide: WideString;
FileNameWideBuffer: PWideChar;
FilterBuffer: WideString;
begin
{$ifdef WindowsUnicodeSupport}
if UnicodeEnabledOS then
FileNameWideBuffer := AllocMem(FileNameBuffe
I managed to get it working with:
{$ifdef WindowsUnicodeSupport}
if UnicodeEnabledOS then
begin
FileNameWide := UTF8Decode(FileName);
FillChar(FileNameWideBuffer^, FileNameBufferLen * 2 + 2, #0);
if Length(FileNameWide) > FileNameBufferLen then
FileNameBufferSi
Hello,
In a LCL code we have:
var
FileNameBuffer: PChar;
FileNameWide: WideString;
FileNameWideBuffer: PWideChar;
FilterBuffer: WideString;
begin
{$ifdef WindowsUnicodeSupport}
if UnicodeEnabledOS then
FileNameWideBuffer := AllocMem(FileNameBufferLen * 2 + 2)
else
FileNameBuff