Click to See Complete Forum and Search --> : Registry Editing--problem


April 29th, 1999, 11:26 AM
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.

Chidu
April 29th, 1999, 12:03 PM
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.

April 29th, 1999, 01:02 PM
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.

akhilesh Kumar
April 29th, 1999, 03:38 PM
Hi,

You can direcly write in to registry?

April 29th, 1999, 04:57 PM
I want to upadte the registry only from my application and not directly.

April 29th, 1999, 09:49 PM
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
);