Click to See Complete Forum and Search --> : Setting Information of NT user through VB


CecileR
July 19th, 2001, 05:23 AM
What's wrong with my code pls:

Private Sub com_Click()

Const RAS_MaxPhoneNumber = &H8

Private Type RAS_USER_0
Privilege As Long
szPhoneNumber(RAS_MaxPhoneNumber) As Byte
End Type

Dim strServer() As Byte
Dim username() As Byte
Dim RasUser_Struc As RAS_USER_0


strServer = StrConv(txtSer & Chr&(0),vbUnicode)
strUser = StrConv(txtUser & Chr&(0),vbUnicode)
RasUser_Struc.Privilege = &H8 Or &H1

res = RasAdminUserSetInfo(strServer(), username(), RasUser_Struc) ''''''''''''Gets an error of 1722


End Sub



cecile

The more u read, the more u do not know

Cakkie
July 19th, 2001, 05:48 AM
When passing an array to an API you must pass a pointer to the first element of the array.

res = RasAdminUserSetInfo(strServer(0), username(0), RasUser_Struc)




Tom Cannaerts
slisse@planetinternet.be

Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook

CecileR
July 19th, 2001, 05:52 AM
I did this but still it wont work.

res = RasAdminUserSetInfo(strServer(), username(), RasUser_Struc

The more u read, the more u do not know

Cakkie
July 19th, 2001, 06:23 AM
What platform are you running on, cause this function is only supported on WinNT 4.
If you are running WinNT4, please suplly the complete code (that is, the RasAdminUserSetInfo function isn't in the API viewer.

Tom Cannaerts
slisse@planetinternet.be

Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook

CecileR
July 19th, 2001, 06:38 AM
I run in WinNT Server Ver 4.0. I didn't find it in rasapi32.dll but in rassapi.dll. I get it somewhere from Windows 98 OS.


cecile

The more u read, the more u do not know