|
-
Feb 21st, 2002, 04:26 AM
#1
Thread Starter
New Member
NetValidateName ???
Hallo,
what is wrong on this code ?
Error 1781(enumerations is out of range).
I found this at the MS-page:
http://msdn.microsoft.com/library/de...mapi2_589x.asp
Private Enum NETSETUP_NAME_TYPE
NetSetupUnknown = 0
NetSetupMachine
NetSetupWorkgroup
NetSetupDomain
NetSetupNonExistentDomain
NetSetupDnsMachine
End Enum
Private Declare Function Validate Lib "NETAPI32.DLL" Alias "NetValidateName" _
(ByVal ServerName As String, ByVal Domaene As String, ByVal _
Account As String, Password As String, NameType As NETSETUP_NAME_TYPE) As Long
'Aufruf:
Result = Validate(StrConv("\\PDC", vbUnicode), StrConv("Domäne", vbUnicode), StrConv("User", vbUnicode), StrConv("Passwort", vbUnicode), NETSETUP_NAME_TYPE.NetSetupDomain)
Who can help ??
Wolfgang
-
Feb 21st, 2002, 04:47 AM
#2
Not tested, but try this:
Private Enum NETSETUP_NAME_TYPE
NetSetupUnknown = 0
NetSetupMachine
NetSetupWorkgroup
NetSetupDomain
NetSetupNonExistentDomain
NetSetupDnsMachine
End Enum
Private Declare Function Validate Lib "NETAPI32.DLL" Alias "NetValidateName" _
(ByVal ServerName As String, ByVal Domaene As String, ByVal _
Account As String, Password As String, NameType As Long) As Long
'Aufruf:
Result = Validate(StrConv("\\PDC", vbUnicode), StrConv("Domäne", vbUnicode), StrConv("User", vbUnicode), StrConv("Passwort", vbUnicode), NetSetupDomain)
-
Feb 21st, 2002, 05:04 AM
#3
Thread Starter
New Member
no, id doesn't work - i'f testet it bevore
No, this is not the solution.
Wolfgang
-
Feb 21st, 2002, 12:25 PM
#4
I just noticed the mistake.
You have to pass both password as NameType ByVal. It doesn't matter if you define the NameType as long or as NETSETUP_NAME_TYPE.
Private Declare Function Validate Lib "NETAPI32.DLL" Alias "NetValidateName" _
(ByVal ServerName As String, ByVal Domaene As String, ByVal _
Account As String, ByVal Password As String, ByVal NameType As NETSETUP_NAME_TYPE) As Long
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
|