LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Get fully qualified domain name in vba

I have the api calls to get the username, servername and domainname but when
I call the NetWkstaUserGetInfo API specifying a level 1 information
structure into the following type declaration the wkui1_logon_domain only
returns the first characters.
For example, I get 'HQ' instead of 'HQ.ABCCO.COM'. Thanks for your help.
....rick

Private Type WKSTA_USER_INFO_1
'name of the user currently logged onto the workstation.
wkui1_username As Long
'domain name of the user account currently logged on
wkui1_logon_domain As Long
'list of other domains browsed by the workstation
wkui1_oth_domains As Long
'name of the authenticating server
wkui1_logon_server As Long
End Type
....
Dim typNTInfo As WKSTA_USER_INFO_1
'call the NetWkstaUserGetInfo API specifying a level 1 information structure
lngRet = apiWkStationUser(0&, 1&, lngPtr)
If lngRet = NERR_Success And lngPtr Then
Call sapiCopyMemory(typNTInfo, ByVal lngPtr, LenB(typNTInfo))
If Not IsNull(lngPtr) Then
With typNTInfo
glbUserName = fStringFromPtr(.wkui1_username)
glbDomainName = fStringFromPtr(.wkui1_logon_domain)
glbServerName = fStringFromPtr(.wkui1_logon_server)
glbOtherDomains = fStringFromPtr(.wkui1_oth_domains)
End With
End If
End If

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
The Domain www.bestnewsletter.eu is now for selling. The Domain for OVER 600 Million People in Europe. TAKE a LOOK !!! Excel Programming 0 June 3rd 06 04:54 PM
The Domain www.bestnewsletter.eu is now for selling. The Domain for OVER 600 Million People in Europe. TAKE a LOOK !!! Excel Programming 0 June 3rd 06 04:54 PM
Bring Back Qualified Sum from another WB Excel Worksheet Functions 4 April 8th 05 01:01 AM


All times are GMT +1. The time now is 02:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"