CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2001
    Posts
    87

    Setting Information of NT user through VB

    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

  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Setting Information of NT user through VB

    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
    [email protected]

    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
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

  3. #3
    Join Date
    Apr 2001
    Posts
    87

    Re: Setting Information of NT user through VB

    I did this but still it wont work.

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

    The more u read, the more u do not know

  4. #4
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Setting Information of NT user through VB

    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
    [email protected]

    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
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

  5. #5
    Join Date
    Apr 2001
    Posts
    87

    Re: Setting Information of NT user through VB

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured