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,
which correct value.( note "c" aftet pointer value). when assign character array strvalue "c" display value of strvalue;
as shown below.
this may foolish question dont understand going wrong. please suggest help, block of code or hint convert whole szbuffer strvalue.
Comments
Post a Comment