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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

finding files across the Network to use in my app. 1

Status
Not open for further replies.

coldan

Programmer
Oct 19, 2008
98
AU
I've used seldirdlg() for this for many years on XP - now using WIN 7 I find I cannot access a list of computers on the Network - thus I can't find a particular file on my server etc.

Is there an API I can call?

Any clues anyone?

Thanks

Coldan
 
First of all SelDirDlg is surely a user defined function. It's no foxpro native function or API function. I don't have that and thus cannot tell you what's wrong with it.

Foxpro natively offers GETDIR() to choose a directory. There's a new bit for the nFlag that will offer a newer interface as of win2000: Bit 4, 64. So nFlag = 64 will show GetDir in a modern look with Desktop and Network in it's folder treeview section:

Code:
GetDir('','please choose a dir','caption',64)

Bye, Olaf.
 
Thanks Mike for pointing that out - does that help you Olaf - as I say it worked in XP?

I now find that the only way I've found is to use mapped drives - but that's a bit of a stretch for most on my users.

Coldan
 
Well, Coldan,

I only find my suspicion is true. You don't need that SelDirDlg in this case, you can simply use my GetDir() variant and you'll have a dialog allowing you to navigate to any network reachable directory without it being mapped. Just scroll down to see the "Network" entry in that dialog and use it to navigate to computers and there network shares.

Bye, Olaf.
 
I just did retry the given command:

Code:
? GetDir('','please choose a dir','caption',64)
[\code]

I navigated to a server share and chose a file and GetDir returned a UNC path \\server\somefolder\someotherfolder\

What do you want more?

Bye, Olaf.
 
Olaf,

I choose what I was using (seldirdlg) a number of years ago as it was recommended by someone ( a guru maybe) and as Mike says its in the FAQ assortment.

To avoid great code changes I have put getdir() in the seldirdlg function and I do indeed get 'everything' as you say.

I will try this 'neat' approach - many thanks for your interest.

Coldan
 
Well seldirdlg is useing BrowseForFolder() of the Shell.Application. GetDir is doing the same. All you need to incorporate is the same new bit flag 64: BIF_NEWDIALOGSTYLE 0x40

So set nBrowseFlags = 64 + 32 + 16 + 1
and you should have the same new dialog.

I have to say that even if I don't make that change and call SelDirDlg as it is in the thread Mike Gagnon linked to, I get the network node in the Folder dialog anyway (using XP SP3).

Bye, Olaf.
 
Thanks Olaf,

I have made the change and do now see Networked drives.

regards

Coldan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top