Need help with registry API function!!! 
Author Message
 Need help with registry API function!!!

I'm trying to use the RegCreateKeyEx function in my program.  I've entered
the following as a declaration:

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 SECURITY_ATTRIBUTES, phkResult As Long,
lpdwDisposition As Long) As Long

when I try to run my program I get a compile error:

user defined type not defined.

What am I doing wrong???  I would appreciate any help I could get!!
Thanks in advance!

Steve



Tue, 04 Mar 2003 11:35:45 GMT  
 Need help with registry API function!!!
Hi, never heard of SECURITY_ATTRIBUTES. Where have you declared this one.


Tue, 04 Mar 2003 14:15:22 GMT  
 Need help with registry API function!!!
it'll probably be because ur decaring somthing as security_atributes:), try
the declaration below, (rember this as i have put it here is all one line,

just copy and past it into ur form.

Private Declare Function RegEnumKeyEx Lib "advapi32.dll" Alias
"RegEnumKeyExA" (ByVal hKey As Long, ByVal dwIndex As Long, ByVal lpName As
String, lpcbName As Long, ByVal lpReserved As Long, ByVal lpClass As String,
lpcbClass As Long, lpftLastWriteTime As Any) As Long
'''''''



Tue, 04 Mar 2003 14:44:47 GMT  
 Need help with registry API function!!!


Hello Steve,

  The thing that's giving you the trouble is :

  lpSecurityAttributes As SECURITY_ATTRIBUTES

You have no user defined type "SECURITY_ATTRIBUTES" declared. This means
that VB can not create a variable "lpSecurityAttributes" that looks like
"SECURITY_ATTRIBUTES".

Regards,
  Rudy Wieser

Quote:
> I'm trying to use the RegCreateKeyEx function in my program.  I've
entered
> the following as a declaration:

> 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 SECURITY_ATTRIBUTES, phkResult As Long,
> lpdwDisposition As Long) As Long

> when I try to run my program I get a compile error:

> user defined type not defined.

> What am I doing wrong???  I would appreciate any help I could get!!
> Thanks in advance!

> Steve




Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Need help declaring API functions to manipulate Windows registry

2. NEED HELP with registry functions - PLEASE !!!

3. Help needed VB6: Using the API to put a string in the registry

4. Need Help with remote registry API

5. Need help with an api function

6. Help needed getting the ChooseFont api function to work

7. need help with REGENUMKEY API function in VB 4 32 bit

8. Need help with API function under NT

9. newbie in api, need help for the function AVIStreamGetFrame

10. I need a help file with a detailed description of Win32 API functions

11. Need help with SetTimer API function!

12. Calling Registry API functions

 

 
Powered by phpBB® Forum Software