views:

84

answers:

1

I'm using GetProfileInt to get key values from the registry. When the location exists, the code works, but when it does not, it returns 0 (and initializes the registry key to 0).

Why doesn't this work?

Code:

SetRegistryKey(_T("MyKey"));
int def = 0x1FFF;
def = GetProfileInt(_T("Subkey"), _T("KeyWithVal"), def);
A: 

Sounds like a bug to me, perhaps there is a difference in the ini-file mapping as specified in the registry setting: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\IniFileMapping.

Gizmomogwai