|
|
|
|
Salut tout le monde,
Je suis toujours sur mon appli pour la base des registre. Mon probleme actuellement est que pour ecrire une string je n'ai pas de probleme mais pour ecrire tous les autres types de donnees je me retrouve avec des conneries...
Exemple:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Synergy\Synergy]
"server"=""
"stringvalue"="dU"
"binaryvalue"=hex:64,55,00,90
"multistringvalue"=hex(7):64,00,55,00,00,00,50,00
"expandablestringvalue"=hex(2):cd,00,cd,00,cd,00,cd,00
au lieu de
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\SynergyMaster\Synergy]
"server"=""
"debug"=dword:00000003
"isServer"=dword:00000001
"stringvalue"="dfv"
"binaryvalue"=hex:01,01,10,11,10,00,11,01,10
"multistringvalue"=hex(7):6a,00,65,00,20,00,73,00,61,00,69,00,73,00,20,00,70,\
00,61,00,73,00,00,00,63,00,65,00,20,00,71,00,75,00,65,00,20,00,63,00,27,00,\
65,00,73,00,74,00,00,00,71,00,75,00,65,00,20,00,63,00,65,00,20,00,74,00,72,\
00,75,00,63,00,00,00,00,00
"expandablestringvalue"=hex(2):71,00,75,00,65,00,73,00,61,00,6b,00,69,00,00,00
. .
\_/
Heeeeeeuuuuuuu
Ca c'est le resultat de mon dernier essai en date, les DWORD disparaissent carrement alors que j'ai pourtant un DWORD mais je peux aussi avoir ca comme resultat:
Heeeeeeuuuuuuu |
Je rentre mes variables la:
void wordXML::load (IXMLDOMElementPtr elt)
{
//string name;
string temp;
elementRoot=elt;
type=3;
//Fill word value name and size
this->getatt ("name",wdName);
//wdName=name.c_str ();
temp=elementRoot->text;
int sep=temp.find_first_of (':');
int end = (int)temp.length() ;
if (sep<2)
{
wdValue=new BYTE[temp.length()+1];
memset(wdValue,0,temp.length()+1);
memcpy(wdValue,temp.c_str (),temp.length());
//wdValue=(DWORD)temp.c_str();
wdType=REG_SZ;
wdSize=sizeof(REG_SZ);
}
else
{
wdValue=new BYTE [temp.substr(sep+1,end).length()+1];
memset(wdValue,0,temp.substr(sep+1,end).length()+1);
memcpy(wdValue,temp.substr(sep+1,end).c_str (),temp.substr(sep+1,end).length());
// wdValue=(DWORD)temp.substr(sep+1,end).c_str ();
string temp2=temp.substr(0,sep);
if (temp2.compare ("hex")==0 )
{
// wdValue=temp.substr (sep+1,end).c_str ();
wdType=REG_BINARY;
wdSize=sizeof(REG_BINARY);
}
else if (temp2.compare("hex(7)")==0)
{
// wdValue=temp.substr (sep+1,end).c_str ();
wdType=REG_MULTI_SZ;
wdSize=sizeof(REG_MULTI_SZ);
}
else if (temp2.compare("hex(2)")==0)
{
// wdValue=temp.substr (sep+1,end).c_str ();
wdType=REG_EXPAND_SZ;
wdSize=sizeof(REG_EXPAND_SZ);
}
else//dword most probably
{
// wdValue=temp.substr (sep+1,end).c_str ();
// wdValue=(DWORD)1;
wdType=REG_DWORD;
wdSize=sizeof(REG_DWORD);
}
}
}
. . \_/ Heeeeeeuuuuuuu |