Registry Editing--problem
Hi,
Environment : vc+=5.0 and winNT,
I want to write from my application in to the registry. I tried using WriteProfile String and this is writing in to Win.ini file and Win NT registry
is not getting updated.
Please let me know how to solve this problem.
Thanx in advance.
Re: Registry Editing--problem
Hi,
The function you used is updating the ini. For registry there are set of function available. For eg. there is one function to set the value of particular key, SetRegistryKey().
try this ou.
Re: Registry Editing--problem
Hi
The problem is I want use Win32 API to do this more over WriteProfileString() takes section name and key name as args.I think this should also work.
Bye.
Re: Registry Editing--problem
Hi,
You can direcly write in to registry?
Re: Registry Editing--problem
I want to upadte the registry only from my application and not directly.
Re: Registry Editing--problem
The WritePrivateProfileInt & WriteProfileInt (& corresponding string functions) were for Win16 systems and are designed to write to the ini file. In Win NT, these functions can reference the registry depending on system configuration. The best bet is to use the actual Registry API. Here is one to start with:
LONG RegSetValueEx(
HKEY hKey, // handle to key to set value for
LPCTSTR lpValueName, // name of the value to set
DWORD Reserved, // reserved
DWORD dwType, // flag for value type
CONST BYTE *lpData, // address of value data
DWORD cbData // size of value data
);