Hello,
I kind of always try to stay away from the pointers, but now I maybe
need to use them...
I think this is not correct yet (at least it does not to 100% what I like) :
var
LSimpleStr : string;
LTmpWStr : array [0..250] of WideChar;
...
LSimpleStr := 'Some text';
mwStrToWide(LSimpleStr, LTmpWStr , 250);
...
procedure mwStrToWide(const AString: string; PWideString: PWideChar;
const ABufferLen: Integer);
begin
FillChar(PWideString^, ABufferLen, 0);
if AString <> '' then
begin
StringToWideChar(AString, PWideString, ABufferLen);
end;
end;
With debugger it seems that the Buffer is not cleared correctly like I
would like to (Much easier to debug when you see more easily the content
of the Array).
And the most worrying part is that the code seems to work other vice,
but I have the feeling that it is not 100% correct.
-TP-
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus