Posted on 2003-11-03
I'm trying to write data to the registry using this function and it keeps returning error code 1450 (insufficient resources). Anyone know what would cause this?
My function looks like:
Public Function SaveSetting(ByVal Section as String, ByVal Key As String, ByVal Setting as String) as Boolean
Dim nRet as Long
Dim hKey as Long
Dim nResult as Long
nRet = RegCreateKeyEx(HKEY_CURRENT_USER, SubKey(Section), 0&, vbNullString, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, ByVal 0&, hKey, nResult)
If nRet = ERROR_SUCCESS Then
If Key = "*" then Key = vbNullString
nRet = RegSetValueEx(hKey, Key, 0&, REG_SZ, ByVal Setting, Len(Setting)) '<- here's where I get the error
SaveSetting = (nRet = ERROR_SUCCESS)
any ideas why I'm getting this error. My virtual disk space is at 1.5GB and I'm sure I have enough memory (1GB RAM), what other resources could be gone? I have nothing else running that uses a lot of resources.