Re: Pointer to a Unicode string - returned by API call
- From: "Maarten Wiltink" <maarten@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 27 May 2005 10:00:31 +0200
"Lester" <vocalise27@xxxxxxxxx> wrote in message
news:1117163273.498690.235450@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
[...]
> Now MIB_IFROW has a member wszName [MAX_INTERFACE_NAME_LEN] which is a
> "Pointer to a Unicode string that contains the name of the interface".
> How do I read this out from the memory, and put in (eg.) a TStrings?
The same way you would for a normal PChar to a long string, mostly.
SetLength your Delphi WideString variable to the required length, and
Move() bytes from [the first character in] the source to [the first
character in] the destination. Watch out for strings SetLength'ed to
zero.
TStrings contains ANSI strings, not wide strings. Characters not present
in your active codepage will become question marks in conversion.
Groetjes,
Maarten Wiltink
.
- Prev by Date: Re: distance between lats and lons
- Next by Date: Re: Farsi text in drawing and text editor
- Previous by thread: Chinese characters and autosize
- Next by thread: Re: Pointer to a Unicode string - returned by API call
- Index(es):
Relevant Pages
|
|