473,396 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

select folder

hi i want to select folder in code so i did some code i.e
Expand|Select|Wrap|Line Numbers
  1. Private Const BIF_RETURNONLYFSIDIRS = 1
  2. Private Const BIF_DONTGOBELOWDOMAIN = 2
  3. Private Const MAX_PATH = 260
  4.  
  5.  
  6. Private Declare Function SHBROWSERFORFOLDER Lib "shell32" (lpbi As BrowsInfo) As Long
  7. Private Declare Function SHGETPATHFROMIDLIST Lib "shell32" (ByVal PIDLIST As Long, ByVal LPBUFFER As String) As Long
  8. Private Declare Function LSTRCAT Lib "Kernel32" Alias "lstrcatA" (ByVal LPSTRING1 As String, ByVal LPSTRING2 As String) As Long
  9.  
  10. Private Type BrowsInfo
  11. hWndOwner As Long
  12. pIDLRoot As Long
  13. pSZDisplayName As Long
  14. lPSZTitle As Long
  15. ulFlags As Long
  16. lpfn_call_back As Long
  17. lparam As Long
  18. iImage As Long
  19. End Type
  20. Private Sub browser()
  21. On Error Resume Next
  22. Dim lpidlist As Long
  23. Dim sbuffer As String
  24. Dim sztitle As String
  25. Dim tbrowseinfo As BrowsInfo
  26.  
  27. sztitle = "Compress and encrypt files(s) in folder"
  28.  
  29. With tbrowseinfo
  30. .hWndOwner = Me.hWnd
  31. .lPSZTitle = LSTRCAT(sztitle, " ")
  32. .ulFlags = BIF_RETURNONLYFSIDIRS + BIF_DONTGOBELOWDOMAIN
  33. End With
  34.  
  35. lpidlist = SHBROWSERFORFOLDER(tbrowseinfo)
  36.  
  37. If (lpidlist) Then
  38.         sbuffer = Space(MAX_PATH)
  39.         SHGETPATHFROMIDLIST lpidlist, sbuffer
  40.         sbuffer = Left(sbuffer, InStr(sbuffer, vbnullclear) - 1)
  41.         txtpath.Text = sbuffer
  42.             If txtpath.Text = " " Then
  43.             Exit Sub
  44.             End If
  45. End If
  46.  
  47.  
  48. End Sub
  49.  
  50.  
  51. Private Sub cmdselect_Click()
  52. On Error GoTo cmdserr
  53. If Text1.Text = "" Then
  54. MsgBox " First code password"
  55. Text1.SetFocus
  56. Exit Sub
  57. End If
  58. Call browser
  59. cmdserr:
  60. kpathname = ""
  61. MsgBox Err.Description
  62.  
  63. End Sub
but why its gives error that

can't find DLL entry point SHBROWSERFORFOLDER in shell32

please tell me
Dec 3 '07 #1
1 1644
debasisdas
8,127 Expert 4TB
Please find more about SHBROWSERFORFOLDER.
Dec 6 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

23
by: ian justice | last post by:
Before i post actual code, as i need a speedyish reply. Can i first ask if anyone knows off the top of their head, if there is a likely obvious cause to the following problem. For the moment i've...
2
by: Pablo | last post by:
Friends! I need to show the dialog "select folder" and get the path selected, using vb.net. The OpenFileDialog control is useless as I want to select a folder and not a file. In vb6 I achieved...
18
by: ian justice | last post by:
Before i post actual code, as i need a speedyish reply. Can i first ask if anyone knows off the top of their head, if there is a likely obvious cause to the following problem. For the moment i've...
1
by: strutsng | last post by:
I want a web page that allows the user to select a folder as input, not files. If I use <input type="file">, I couldn't select a folder as input, I can only select a single file as input. In my...
3
by: microsoft | last post by:
vb.net What's the best way to allow the user to select an existing folder or create a new one and select. Not a file, just a folder.
3
by: djpaul | last post by:
Hello guys, I'm busy with an photogallery and i wanted to implent this script i wrote to select a folder and put there the photo's in. But i only get 1 folder in the drop-down menu and the other is...
4
by: dkirkdrei | last post by:
I am having a problem getting results back from a SELECT statement using the script below. The field names contain decimals and I am not sure wether or not this is causing the problem or not?? I am...
2
by: Kuldeep | last post by:
Hi all, I have a requirement, where the user has to select a folder and all the files in that folder have to be imported to my databse. To acheive this i need a control which enables the user to...
2
by: abhijitmishra1102 | last post by:
Hi, i want to export files from DB to a selected folder on client machine. But i dont know how 2 show a select folder dialog box . we hav file seleect dialogbox but no folder select dialogbox ....
5
by: remya1000 | last post by:
i'm using VB.NET 2003 application program. by using OpenFileDialog, we can select the file name or file path. OpenFileDialog1.ShowDialog() pgmPath.Text =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.