|
-
Mar 27th, 2003, 01:58 AM
#1
Thread Starter
Member
API calls in VB .NET
Hi!
When using API calls in .NET like in VB 6 I can't obtain the same result. Actually, there are no results at all!
What is the problem?
Here are functions I tryed to use:
Code:
Private Declare Function RegOpenKeyEx Lib "advapi32" Alias "RegOpenKeyExA" _
(ByVal hKey As Long, _
ByVal lpSubKey As String, _
ByVal ulOptions As Long, _
ByVal samDesired As Long, _
ByRef phkResult As Long) As Long
Private Declare Function RegQueryValueEx Lib "advapi32" Alias "RegQueryValueExA" _
(ByVal hKey As Long, _
ByVal lpValueName As String, _
ByVal lpReserved As Long, _
ByRef lpType As Long, _
ByVal lpData As String, _
ByRef lpcbData As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32" _
(ByVal hKey As Long) As Long
Thank you.
Last edited by Penavin; Mar 27th, 2003 at 02:11 AM.
Penavin 
-
Mar 27th, 2003, 07:48 AM
#2
Let me in ..
Re: API calls in VB .NET
Originally posted by Penavin
Hi!
When using API calls in .NET like in VB 6 I can't obtain the same result. Actually, there are no results at all!
What is the problem?
Here are functions I tryed to use:
Code:
Private Declare Function RegOpenKeyEx Lib "advapi32" Alias "RegOpenKeyExA" _
(ByVal hKey As Long, _
ByVal lpSubKey As String, _
ByVal ulOptions As Long, _
ByVal samDesired As Long, _
ByRef phkResult As Long) As Long
Private Declare Function RegQueryValueEx Lib "advapi32" Alias "RegQueryValueExA" _
(ByVal hKey As Long, _
ByVal lpValueName As String, _
ByVal lpReserved As Long, _
ByRef lpType As Long, _
ByVal lpData As String, _
ByRef lpcbData As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32" _
(ByVal hKey As Long) As Long
Thank you.
Check the API call support for .NET MSDN. They have changed the syntax for calling API's. Also you may not need to use APIs at all. They have wrapped up lot of APIs in the form of classes and most of the registry APIs are already available using .NET classes.
-
Mar 27th, 2003, 12:28 PM
#3
-
Mar 27th, 2003, 01:22 PM
#4
Sleep mode
Originally posted by PT Exorcist
change longs to integers
I don't think so , long is long . Forget about that and use Registery class and Win32 Class . It's more more eaiser .
-
Mar 27th, 2003, 03:22 PM
#5
Thread Starter
Member
Hi!
Yes, with Int32 is better, but I still can't obtain desired result. Function returns '2' and I am happy only with '0'
Penavin 
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
|