/////////////////////////////////////////////////////////////// // $Source: winmain.cpp // $Author: Christophe Mortier // // $Description: Program that test the library CMReg // !!! Be carfull with the member Delete , // always do a copy of your register before // testing!!! // // $Log: // Revision 1.0 05/10/1999 Mortier /////////////////////////////////////////////////////////////// #include #include #include "CMReg.h" void main() { // write and read rawdata not yet tested char stg[18]; CMReg akey; akey.Open("Software\\Chriskey\\TestKey"); akey.WriteByte("testbyte",12); akey.WriteWord("testword",3450); akey.WriteDWord("testdword",9000000); akey.WriteString("testString","ceci est un test"); akey.ReadString("testString",stg,17); cout << (int)akey.ReadByte("testbyte") << endl; cout << akey.ReadWord("testword") << endl; cout << akey.ReadDWord("testdword") << endl; cout << stg << endl; // not really needed because of the destructor akey.Close(); // now I delete Chriskey and all it's Subkeys if(akey.Delete("Software\\Chriskey")) cout << "deleted" << endl; else cout << "not deleted" << endl; }