|
-
Jul 29th, 2000, 09:49 AM
#1
Thread Starter
Hyperactive Member
Aaron I get and Error Sub or Function not Defined for the Sub. the line RegCreateKey gets highlighted
Sub SaveRegSetting(ByVal lKey As Long, ByVal sSubKey As String, ByVal sValue As String, ByVal vData As Variant)
'Save a String/Long Value to the Registry
Dim lRegKey As Long
Dim lType As Long
Dim lData As Long
Dim sData As String
'Determine the type of Data being Saved
lType = IIf(VarType(vData) = vbString, 1, 4)
If lType = 4 Then
'Long Data Type
lData = vData
Else
'String Data Type
sData = vData
End If
If RegCreateKey(lKey, sSubKey, lRegKey) = 0 Then
'Open/Create the Registry Key
If lType = 1 Then
'Save the String Value to the Registry
Call RegSetValueEx(lRegKey, sValue, 0&, lType, ByVal sData, Len(sData))
Else
'Save the Long Value to the Registry
Call RegSetValueEx(lRegKey, sValue, 0&, lType, lData, 4)
End If
'Close the Registry Key
Call RegCloseKey(lRegKey)
End If
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|