Solved

Looking for a special ActiveX.

Posted on 2002-03-16
5
144 Views
Last Modified: 2010-05-02
Hi There,

I need to get a PATH from a user.
I'm using CommonDialog Control for browsing the HDD.

But in CD u need to select a FILE to get all the path, there is a way to select a path without select a file ?

0
Comment
Question by:computech1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 2

Accepted Solution

by:
DanAvni earned 100 total points
ID: 6873532
0
 

Author Comment

by:computech1
ID: 6873586
The URL doesn't work ..
0
 
LVL 2

Expert Comment

by:DanAvni
ID: 6873633
'**************************************
'Windows API/Global Declarations for :Br
'     owse Folder Dialog
'**************************************
Private Const BIF_RETURNONLYFSDIRS = 1
Private Const BIF_DONTGOBELOWDOMAIN = 2
Private Const BIF_BROWSEFORCOMPUTER = &H1000

Private Const MAX_PATH = 260


Private Declare Function SHBrowseForFolder Lib "shell32" _
    (lpbi As BrowseInfo) As Long


Private Declare Function SHGetPathFromIDList Lib "shell32" _
    (ByVal pidList As Long, _
    ByVal lpBuffer As String) As Long


Private Declare Function lstrcat Lib "kernel32" Alias "lstrcatA" _
    (ByVal lpString1 As String, ByVal _
    lpString2 As String) As Long


Private Type BrowseInfo
    hwndOwner As Long
    pIDLRootAs Long
    pszDisplayName As Long
    lpszTitle As Long
    ulFlagsAs Long
    lpfnCallbackAs Long
    lParam As Long
    iImage As Long
    End Type



'**************************************
' Name: Browse Folder Dialog
' Description:Have ever wondered if ther
'     e is an ActiveX object that make you bro
'     wse for a folder. This API functions cal
'     ls make the browse dialog
' By: Ziad Mohammad
'
' Inputs:Start a new Project and Add a c
'     ommand button on the form named command1
'    
'
' Assumes:This API function calls displa
'     y the structure of your computer and all
'     ow the use to select a folder

'
'This code is copyrighted and has' limited warranties.Please see http://w
'     ww.Planet-Source-Code.com/xq/ASP/txtCode
'     Id.6710/lngWId.1/qx/vb/scripts/ShowCode.
'     htm'for details.'**************************************



Private Sub Command1_Click()
    'Opens a Treeview control that displays
    '     the directories in a computer
    Dim lpIDList As Long
    Dim sBuffer As String
    Dim szTitle As String
    Dim tBrowseInfo As BrowseInfo
    szTitle = "This is the title"


    With tBrowseInfo
        .hWndOwner = Me.hWnd
        .lpszTitle = lstrcat(szTitle, "")
        .ulFlags = BIF_RETURNONLYFSDIRS_
        +BIF_DONTGOBELOWDOMAIN
       
    End With
    lpIDList = SHBrowseForFolder(tBrowseInfo)


    If (lpIDList) Then
        sBuffer = Space(MAX_PATH)
        SHGetPathFromIDList lpIDList, sBuffer
        sBuffer = Left(sBuffer, InStr
        (sBuffer, vbNullChar) - 1)
        MsgBox sBuffer
    End If
End Sub
0
 

Author Comment

by:computech1
ID: 6873733
In one word : WOW !!

thanx Dan
0
 

Author Comment

by:computech1
ID: 6876086
Dan

I Still unable to browse Net drives ...
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month5 days, 9 hours left to enroll

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question