From 7740ebb87b8aa440f10095a77fea5d781844dd97 Mon Sep 17 00:00:00 2001 From: Ian C Date: Sun, 17 Apr 2005 00:34:01 +0000 Subject: Added Registry class and default message box titles --- src/test/w32dtst.cpp | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'src/test/w32dtst.cpp') diff --git a/src/test/w32dtst.cpp b/src/test/w32dtst.cpp index 6d579cc..bc5e6a6 100644 --- a/src/test/w32dtst.cpp +++ b/src/test/w32dtst.cpp @@ -334,6 +334,40 @@ private: } }; +static void ReadInt(const char *mode, W32DLib::Registry& r, const char *name) +{ + unsigned i; + bool res=r.Read(name,i); + + std::cout << "ReadInt(mode=" << mode + << ") res=" << res << " val=" << i << std::endl; +} + +static void ReadStr(const char *mode, W32DLib::Registry& r, const char *name) +{ + std::string i; + bool res=r.Read(name,i); + + std::cout << "ReadStr(mode=" << mode + << ") res=" << res << " val=" << i << std::endl; +} + +static void WriteInt(const char *mode, W32DLib::Registry& r, const char *name) +{ + unsigned i=666; + bool res=r.Write(name,i); + + std::cout << "WriteInt(mode=" << mode << ") res=" << res << std::endl; +} + +static void WriteStr(const char *mode, W32DLib::Registry& r, const char *name) +{ + std::string i("Hello World"); + bool res=r.Write(name,i); + + std::cout << "WriteInt(mode=" << mode << ") res=" << res << std::endl; +} + int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, @@ -348,6 +382,18 @@ int WINAPI WinMain (HINSTANCE hInstance, std::cout << "DATAX_TEST enabled" << std::endl; #endif + W32DLib::Registry rw(HKEY_CURRENT_USER,"Software\\Noddybox\\w32dlibtest",false); + W32DLib::Registry rd(HKEY_CURRENT_USER,"Software\\Noddybox\\w32dlibtest"); + + ReadInt("rw",rw,"int"); + ReadStr("rw",rw,"str"); + ReadInt("ro",rd,"int"); + ReadStr("ro",rd,"str"); + WriteInt("rw",rw,"int"); + WriteStr("rw",rw,"str"); + WriteInt("ro",rd,"int"); + WriteStr("ro",rd,"str"); + i=t.ShowModal(hInstance,NULL); if (i==IDOK) -- cgit v1.2.3