General information
Category:
Windows API functions
Title:
Convert To VFP Code
The VB Code from "allapi.net" below allows me to select an Active Directory Container.
I wonder if somebody here can convert this to VFP code.
I have tried my best but i think my best is not good enough.LOL
I am having problem with API structures in VFP. Please guide me.
Thanks in advance.
*----------------------------------------
Private Const MAX_PATH = 160
Private Type DSBROWSEINFO
cbStruct As Long
hwndOwner As Long
pszCaption As String
pszTitle As String
pszRoot As String
pszPath As Long
cchPath As Long
dwFlags As Long
pfnCallback As Long
lParam As Long
dwReturnFormat As Long
pUserName As String
pPassword As String
pszObjectClass As String
cchObjectClass As Long
End Type
Private Declare Function DsBrowseForContainer Lib "dsuiext" Alias "DsBrowseForContainerA" (pInfo As DSBROWSEINFO) As Long
Private Sub Form_Load()
Dim dsbi As DSBROWSEINFO, szResult As String
'initialize the DSBROWSEINFO structure
szResult = Space(MAX_PATH)
dsbi.cbStruct = Len(dsbi)
dsbi.pszCaption = "The container picker"
dsbi.pszTitle = "Pick a container for this example. This will be returned if the user clicks ""OK"""
dsbi.pszPath = StrPtr(szResult)
dsbi.cchPath = Len(szResult)
'call the function
DsBrowseForContainer dsbi
'show the result
MsgBox szResult
End Sub
*----------------------------------------
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only