Re: BYTE array into const OLECHAR *
- From: "Alexander Nickolov" <agnickolov@xxxxxxxx>
- Date: Tue, 16 May 2006 16:20:47 -0700
No, both are wrong. It'd be T2OLE, or use T2BSTR directly
forgoing SysAllocString:
pbstr[i] = T2BSTR((const TCHAR *)pszValue));
Note you can avoid the possible ANSI to UNICODE conversion
by using RegQueryValueExW directly:
pbstr[i] = W2BSTR((const WCHAR *)pszValue));
In that case your buffer has to be twice as big (it probably needs
that even now, seeing as you use the TCHAR version of the API...)
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
"Brian Muth" <bmuth@xxxxxxxx> wrote in message
news:%23AW%23ClSeGHA.3952@xxxxxxxxxxxxxxxxxxxxxxx
A2OLE
Brian
.
- Follow-Ups:
- Re: BYTE array into const OLECHAR *
- From: Simon Trew
- Re: BYTE array into const OLECHAR *
- References:
- BYTE array into const OLECHAR *
- From: Tech
- Re: BYTE array into const OLECHAR *
- From: Tech
- Re: BYTE array into const OLECHAR *
- From: Brian Muth
- BYTE array into const OLECHAR *
- Prev by Date: Re: Who is responsible for refreshing the UI?
- Next by Date: Re: Who is responsible for refreshing the UI?
- Previous by thread: Re: BYTE array into const OLECHAR *
- Next by thread: Re: BYTE array into const OLECHAR *
- Index(es):
Relevant Pages
|