Ah!. (Just got back). That error message may be because of the way the RegCreateKeyEx API is declared. The 7th parameter may be declared as "lpSecurityAttributes as SECURITY_ATTRIBUTES" - a UDT. Declaring it as a Long should stop any errors. ie:
vb Code:
Public Declare Function RegCreateKeyEx Lib "advapi32.dll" Alias "RegCreateKeyExA" _ (ByVal hkey As Long, ByVal lpSubKey As String, ByVal Reserved As Long, _ ByVal lpClass As String, ByVal dwOptions As Long, ByVal samDesired As Long, _ lpSecurityAttributes As Long, phkResult As Long, lpdwDisposition As Long) As Long




Reply With Quote