Re: BYTE array into const OLECHAR *

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



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




.



Relevant Pages

  • Re: Oposite of *ptr functions?
    ... a native DLL to avoid the ANSI to UNICODE conversion. ... exactly what StrPtr does -- it gives you a pointer to a Unicode BSTR ...
    (comp.lang.basic.visual.misc)
  • Re: Problem about error code 0x80070078
    ... You can try using ANSI builds instead of UNICODE... ... for the majority of Win32 API functions MSLU works alright. ... Microsoft MVP, MCSD ...
    (microsoft.public.win32.programmer.ole)
  • Re: Office 2003 (frontpage 2003) Tutorials
    ... Avoid working within the site folder via Windows Explorer or any other application. ... FrontPage Resources, WebCircle, MS KB Quick Links, etc. ... >> Thomas A. Rowe (Microsoft MVP - FrontPage) ...
    (microsoft.public.frontpage.client)
  • Re: Data encryption ?
    ... The reason is I attempt to avoid having to use the Windows Registry ... > Aspnet_setreg.exe utility that is described in Knowledge base article ... > If you have VS.NET installed, then you can load IE or load up the MSDN ... > Microsoft MVP - ASP.NET ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: no values
    ... Microsoft MVP (Excel) ... i used sum function to make total it shows 0 always ... avoid the 0..... ...
    (microsoft.public.excel.newusers)