c++ - Converting LPBYTE to char* -


after 2 hours of google on "convert lpbyte char*" found result relates "regqueryvalueexw"

no 1 use "lpbyte" other "regqueryvalueexw" function.

my question arise unicode , ascii conversion if use regqueryvalueex give me ascii values correct multinational point view not helping me.

now,

i have following code ,

char* getstringregkey(hkey hkey, lpcwstr strvaluename, char* strvalue, char* strdefaultvalue) {     strvalue = strdefaultvalue;     char szbuffer[512];     dword dwbuffersize = sizeof(szbuffer);     ulong nerror;     lpcwstr temppassingstring;     char* hostname;     nerror = regqueryvalueexw(hkey, strvaluename, 0, null, (lpbyte)szbuffer, &dwbuffersize);     if (error_success == nerror)     {         strvalue = szbuffer;     }     uses_conversion;     return strvalue; } 

this show me szbuffer array like, enter image description here

which correct value.( note "c" aftet pointer value). when assign character array strvalue "c" display value of strvalue;

as shown below.

enter image description here

this may foolish question dont understand going wrong. please suggest help, block of code or hint convert whole szbuffer strvalue.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -