本帖最后由 ggqyt 于 2011-03-27 18:20:25 编辑

解决方案 »

  1.   


            TCHAR szProfile[]=_T("0x86");
    int nValue;
    WritePrivateProfileString(_T("Test"),_T("Test"),szProfile,_T("d:\\Profile.ini"));
    nValue = GetPrivateProfileInt(_T("Test"),_T("Test"),0,_T("d:\\Profile.ini"));
    cout<<hex<<nValue;
      

  2.   

       TCHAR szHex[10]={0};
    _stprintf_s(szHex,10,_T("%x"),0x86);
    int nValue;
    WritePrivateProfileString(_T("Test"),_T("Test"),szHex,_T("d:\\Profile.ini"));
    TCHAR szHex[10]={0};
    GetPrivateProfileString(_T("Test"),_T("Test"),0,szHex,10,_T("d:\\Profile.ini"));
    unsigned char byTest;
    _stscanf(szHex,"%x",&byTest);