On Mon, 22 Aug 2011, Tommi Prami wrote:

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);

At least this is wrong, since the buffer is 2*250 wide. FillChar assumes that 1 char = 1 byte.

Michael.

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to