Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use common dialog box to create and get directory path

Status
Not open for further replies.

Mrall

Programmer
Nov 22, 2008
64
US
I have vfp6.0 which doesn't have the getdir() parameter 64 to allow the user to create the directory if it doesn't exist. The activex Common Dialog control for a form allows the user to create a directory if it doesn't exist. But, is there a way to get the path? If so, how is it done?

If it can't be done with a Common Dialog control, is there any routines out there that will do this.

Thanks
 

And here is the news2news page:

And maybe you choose to use the Shell.Application solution from there:
Code:
oShell = CREATEOBJECT("Shell.Application")

oFolder = oShell.Application.BrowseForFolder(_screen.HWnd,;
        "Select Folder", 1, "c:\Program Files")

IF NOT ISNULL(oFolder)
        ? oFolder.self.Path
ENDIF

Bye, Olaf.
 
What is posted above is correct but errors out as is.

Here is the exact code to do a getdir() with a make directory option. (for people who don't have vfp7-9 that has the parameter 64 option)

oShell = CREATEOBJECT("Shell.Application")

oFolder = oShell.Application.BrowseForFolder(0,"Select Folder",0,"C:\")

IF NOT ISNULL(oFolder)
? oFolder.self.Path
ENDIF

oFolder.self.Path returns the path

Thanks all
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top