Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to convert byte[] to StringT?

New Here ,
Nov 17, 2010 Nov 17, 2010

In FDK development, I want to access registry to get information.

StringT GetDirInfoFromReg()
{
   HKEY hKey;      
    CharT       SubKeyName[]= "SOFTWARE\\airport raw data";      
     CharT      ValueName[] = "template"; 
  CharT keyValue[64];
  IntT i;
       
     BYTE        ValueData[64];      
     DWORD       Buffer; 
  StringT  key=NULL;
       
     //open key   
     if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,SubKeyName,0,KEY_ALL_ACCESS,&hKey) !=ERROR_SUCCESS)      
     {      
         printf(      "Error:        Regedit        cannot        be        opened! ");      
     }      
     else      
     {      
     //read key value      
     Buffer=sizeof(ValueData);      
     if(RegQueryValueEx(hKey,ValueName,0,NULL,ValueData,&Buffer)==ERROR_SUCCESS)      
     {
          //Convert ValueDate  to StringT

    key=(StringT)ValueData//***************************Error:I can not get the right data.

     RegCloseKey(hKey);      
     }      
           
     }

  return key;


}

I don't know how to convert byte to StringT.

TOPICS
Structured
785
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Nov 18, 2010 Nov 18, 2010

zhaopeng,

This works for me:

key = F_StrCopyString((StringT)ValueData);

Russ

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 21, 2010 Nov 21, 2010
LATEST

Russ Ward!

Thank you very much!

======= 2010-11-18 20:54:22 您在来信中写道:=======

>zhaopeng,

>This works for me:

>key = F_StrCopyString((StringT)ValueData);

>Russ

>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines