Re: convert WCHAR in byte[] to string

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"centrino" <centrino@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D9D5C5E8-646E-4B01-8B22-6B551C82B7AC@xxxxxxxxxxxxxxxx
>i get:
>
>
> pBufferSize: 772
> pBuffer: \Device\{91E405CA-9D5E-4366-BB44-3B27E09C6C35}
>
> i think i would get more, i don't know !?
>
> regards
>
>
>

I guess you do have more. Your pBufferSize is 772 ( don't know what exactly,
chars or bytes), the string is shorter anyway.
I guess the buffer returned contains strings delimitted with 'nulls', like
this...
\Device\{91E405CA-9D5E-4366-BB44-3B27E09C6C35}\0\0
\Device\{..........................................................}\0\0

You can check the stringbuilders Length after return.
If I'm right, you can use ToString(int startindex, int length) to retrieve
the individual strings from the StringBuilders buffer.


Willy.


.



Relevant Pages

  • Re: BDS C# and Framework version
    ... AFAIK their strings are #0-based? ... best regards ... Thomas ... Prev by Date: ...
    (borland.public.delphi.non-technical)
  • Re: regular expression problem
    ... in fact i'd like to apply this function to strings (or ordered ... For this reason proposed to use regular expression. ... best regards. ... Prev by Date: ...
    (comp.lang.python)
  • VB2005 Express Edition help with append
    ... I'm trying to append these two strings: RC and 14 with the following ... Regards, ... Prev by Date: ...
    (microsoft.public.dotnet.general)
  • Length of data inside a field
    ... I have a table with field of strings. ... How can i do that on a ADOquery. ... Best Regards ... Prev by Date: ...
    (borland.public.delphi.database.ado)
  • Re: Fastcode StrToInt32 B&V 0.5.0
    ... The Fastcode Project: ... I think GlobalStr:= '123'; ... length strings in all Fastcode functions. ...
    (borland.public.delphi.language.basm)