hi there... i having some trouble understanding the registry editing/reading functions that i've found in the MSDN on the web. How really works? does anyone have a "clear" example?. Thanks anyway!
I'm really just getting started with MS C++ 6.0.
Here is an example of how I populated the registry with a
string value. It's fairly simlar with an int value.
I still cannot work out how to store a datetime? I am thinking of resorting to converting the datetime to int or strings then storing it. If you find out let me know.
//This is a small sample which writes a
CWinApp *pApp = AfxGetApp();
CString strSection = "RegistryFolderName";
CString strStringItem = "Application Dir";
CString s_application_dir = "Value in the registry";
// Set the Application Directory String
// If it does not exist creates a new string
pApp->WriteProfileString(strSection,strStringItem,s_application_dir );
// Get the applcation string from the registry
s_application_dir = pApp->GetProfileString(strSection, strStringItem);
Try ShGetValue and SHSetValue for direct access to registry. Of course, this won't teach you squat, but if you insist on MSDN, try as well, RegOpenKeyEX and all related functions.
You have to be carefull with all the parameters you submit to the functions, as you might be spending whole nights wondering just why some data does not get written into the registry.
If you don't need very much, use the first two functions I wrote above. It might help. [red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal... once stated: methane@personal.ro
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.