Browse for Drive/Dir/File using MFC - possible?

Is it possible, in an MFC app, to use one of the standard dialog-based
classes/functions to browse for either a drive OR a directory OR a file?

Any help appreciated,
Steve.


0
ctrl (5)
9/18/2003 11:38:26 AM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
518 Views

Similar Articles

[PageSpeed] 33

    Take a look at the SHBrowseForFolder() API.

--
Cheers
Check Abdoul [ VC++ MVP ]
-----------------------------------

"Steve Carroll" <ctrl@optusnet.com.au> wrote in message
news:#tR$bmdfDHA.696@TK2MSFTNGP09.phx.gbl...
> Is it possible, in an MFC app, to use one of the standard dialog-based
> classes/functions to browse for either a drive OR a directory OR a file?
>
> Any help appreciated,
> Steve.
>
>


0
CheckAbdoul
9/18/2003 1:31:09 PM
Hi Check. I've already looked at SHBrowseForFolder(), but can't see how it
can be used to retrieve files; it appears to only deal with folders. Also,
maybe I'm a little slow, but I can't follow how to initialise the ITEMIDLIST
that belongs to the BROWSEINFO struct to be passed to SHBrowseForFolder().
The documentation is very hard to follow.

....Steve

 "CheckAbdoul" <636865636B6162646F756C406E6F7370616D2E6D7670732E6F7267>
wrote in message news:OnT38jefDHA.2152@tk2msftngp13.phx.gbl...
>     Take a look at the SHBrowseForFolder() API.
>
> --
> Cheers
> Check Abdoul [ VC++ MVP ]
> -----------------------------------
>
> "Steve Carroll" <ctrl@optusnet.com.au> wrote in message
> news:#tR$bmdfDHA.696@TK2MSFTNGP09.phx.gbl...
> > Is it possible, in an MFC app, to use one of the standard dialog-based
> > classes/functions to browse for either a drive OR a directory OR a file?
> >
> > Any help appreciated,
> > Steve.
> >
> >
>
>


0
ctrl (5)
9/18/2003 2:23:21 PM
    Hello John,
                     this appears to be the most promising so far. I've
downloaded a couple of articles from CodeGuru, dealing with sub-classing
CFileDialog, that might help. Most examples that I've looked at have been
able to browse for files OR folders, but not files, folders, or drives at
the same time.
    My application deals with file, folder or drive comparisons or
verification, so the user needs to be able to, for instance, select a folder
as the source and a CD drive as the target for comparison. My search,
verification and comparison functions are written and working well, but I
need a neat way to pass parameters. Currently, I'm using the command-line
for testing.
    Otherwise, I'm considering FindFirstFile() and FindNextFile(), with a
TreeView control for display. I left this until almost last because I
thought it would be the easy part. It's looking like a bigger job than I'd
hoped.

.... Steve

"John Smith" <someone@some.where.inter.net> wrote in message
news:e9pW#MffDHA.1712@TK2MSFTNGP11.phx.gbl...
> Check also CFileDialog...


0
ctrl (5)
9/18/2003 3:25:08 PM
Check also CFileDialog...

"Steve Carroll" <ctrl@optusnet.com.au> wrote in message
news:uc$HkCffDHA.556@TK2MSFTNGP11.phx.gbl...
> Hi Check. I've already looked at SHBrowseForFolder(), but can't see how it
> can be used to retrieve files; it appears to only deal with folders. Also,
> maybe I'm a little slow, but I can't follow how to initialise the
ITEMIDLIST
> that belongs to the BROWSEINFO struct to be passed to SHBrowseForFolder().
> The documentation is very hard to follow.
>
> ...Steve
>
>  "CheckAbdoul" <636865636B6162646F756C406E6F7370616D2E6D7670732E6F7267>
> wrote in message news:OnT38jefDHA.2152@tk2msftngp13.phx.gbl...
> >     Take a look at the SHBrowseForFolder() API.
> >
> > --
> > Cheers
> > Check Abdoul [ VC++ MVP ]
> > -----------------------------------
> >
> > "Steve Carroll" <ctrl@optusnet.com.au> wrote in message
> > news:#tR$bmdfDHA.696@TK2MSFTNGP09.phx.gbl...
> > > Is it possible, in an MFC app, to use one of the standard dialog-based
> > > classes/functions to browse for either a drive OR a directory OR a
file?
> > >
> > > Any help appreciated,
> > > Steve.
> > >
> > >
> >
> >
>
>


0
someone (38)
9/18/2003 3:45:42 PM
Reply:

Similar Artilces:

XML and DOM through MFC?
I am new to DOM and XML. 1. Certain device commands are to be stored in a reference file. The commands exchanged between the device and the PC should be trapped. The trapping component must parse through the reference file. It is recommended that the reference file be XML. Can I access Microsoft DOM through MFC? 2. The commands that are exchanged are to be stored as HTML and RTF. How can I do it through MFC? Harish wrote: > I am new to DOM and XML. > 1. Certain device commands are to be stored in a reference file. The > commands exchanged between the device and the PC should be...

Using HTML template in 2007/Vista
Not sure if this is the right sub-forum or not.... I'm able to install an HTML page as a template using Office 2007 on an XP machine, but the same process does not work on Vista machines. The template is saved to the proper location but the problem is that when Outlook opens the form, it opens as Plain Text rather than HTML. I haven't been successful finding any solutions googling the problem - anyone here know of a fix? -- rpw ...

backing up files
Does anyone know if it is possible to back up my money files to a CD RW disc. Please e-mail an answer to me. Why should I email you an answer when the answer to this question has already been posted three or four times already this week? Please read the posts. "John Koegel" <bigjohn1016@mns.com> wrote in message news:044501c348bf$62e760b0$a001280a@phx.gbl... > Does anyone know if it is possible to back up my money > files to a CD RW disc. Please e-mail an answer to me. ...

PDF file #7
I have Publisher 2002 and would like to insert a .pdf file into a document I am working on. How do / Can I do this? Many thanks, Ger ...

No date fields appear when exporting/importing CSV file?
Hello All, I need to convert some legacy emails from another system to a format that can be read by Outlook. The preferred format is CSV text, which we plan to import into Outlook. I noticed when playing with the export/import that the following seem to be the standard fields that get exported into an Outlook generated CSV file: "Subject", "Body (text)", "From: (Name)", "From: (Address)", "From: (Type)", "To:(Name)", "To: (Address)", "To: (Type)", "CC: (Name)", "CC: (Address)", "CC: (...

compressed drive for exchange db and logs
Is it bad to have exchange databases and logs on a compressed NTFS drive? On Wed, 27 Jul 2005 15:35:51 -0700, "tony" <none@none.com> wrote: >Is it bad to have exchange databases and logs on a compressed NTFS drive? > Yes. http://support.microsoft.com/kb/318116/en-us/ ...

How to use wincrypt.h?
Hi: I use it in a console app. I do this: The first I don't include .h file. Then add #define _WIN32_WINNT 0x0400 and #include <wincrypt.h> in the stdafx.h. compile ... error: error C2146: syntax error : missing ';' before identifier 'HRESULT' fatal error C1004: unexpected end of file found How to do? thanks! >error C2146: syntax error : missing ';' before identifier 'HRESULT' >fatal error C1004: unexpected end of file found > >How to do? Try adding #include <windows.h> before. Dave Thank you. "David Lowndes" ...

Exchange/Outlook 2003
In an effort to make sure we never reach the 16GB threshold for the SBS 2003 Exchange Info Store, I'm looking to setup a GPO to give everyone consistent AutoArchive settings as well as a common location for the PST file. I have already downloaded the Office Administrative Templates for Outlook 2003, so I already have found the settings I want to modify and have made the changes, I just haven't made them live on the domain yet. My thoughts to date: * create two GPOs, one for the PST location, one for the autoarchive settings themselves * set PST location to local drive, or common netw...

How do I list more opened Word docs under the File menu
Word 2003 displays the last 4 Word files opened on clicking the File menu. I would like to increase this to about 20. Can this be done, and if so, how? In Word 2003, the maximum number that can be shown is 9 and it can be set via Tools>Options>General -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP, originally posted via msnews.microsoft.com "Wellington" <Wellington@discussions.microsoft.com> wrote in message news:A9B8C9D4-4F78-4A92-94C6-8DC0D41388...

insert password using vb
I have multi worksheets in a template with formulas. I can hide th formulas but if I add a password, my macros stop and ask for th password when the macro is in a protected worksheet. Is there a way o adding the password to a macro so that the macro will run smoothl without stopping and asking for a manual insertion of the password? Thanks Do -- abbevill ----------------------------------------------------------------------- abbeville's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=976 View this thread: http://www.excelforum.com/showthread.php?threadid=26122 ...

same subform used in two different forms
Hi Folks, Is it possible to use the same subform in two different main forms simultaneously? If it's possible, is it good practice? I can foresee that there may be problems with code, but the subform I'm thinking of is very basic. Three tables: tblFamily FamID (primary key) FamLastName tblIndividual IndID (primary key) InFamID FirstName MiddleName ....other personal data tblAddress AddressID AdFamID street city state zip Two main forms for different types of data entry frmFamily with family information on the main form and address information...

XML TreeNode.Parent property when using 2.0 TreeView?
How do I get a TreeNode.Parent property when using the 2.0 TreeView control? When the data source is an XML file there may be redundant names in the tree. For example, when a child node with the value of 'name' is selected I don't have a clue how to get the name of its parent which may be 'person' or 'school.' <%= Clinton Gallagher "clintonG" <csgallagher@REMOVETHISTEXTmetromilwaukee.com> wrote in message news:%23erL6WOXFHA.3532@TK2MSFTNGP10.phx.gbl... > How do I get a TreeNode.Parent property when using the 2.0 TreeView > control? &...

Not even Office Live Using Document Connection
> This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --B_3331376369_11931625 Content-type: text/plain; charset="ISO-8859-1" Content-transfer-encoding: 8bit While others are saying they can use the SP2 version of Document Connection to Office Live but not Sharepoint I can�t even get connected to my Office Live Workspace which I have been using via the browser for a long time. I can't add my Office LIve Workspace location to Document Connection. The gear just spins and what�s almost as bad it...

data error while opening files
when i open excel or word existing file i getting contents as "DATAError [47 0F 94 93 F4 K5]" instead of my saved data. pls help me solving. My all word & excel files are have same problem. ...

Cannot open Publisher File
I'm using Publisher 2003 and have a 100 MB (66 MB Compressed) publisher file that consitently hangs up publisher when trying to open it. Once in a while, the first page will load, but when you try to switch to another page, the program hangs up again. I've tried several PCs to open the file with including a P4 file server with 2 GB of RAM. nothing seems to make a difference. I can tell through the Task Manager that the app is doing some sort of processor work, but no disk access is being performed. I tried opening the file in Safe Mode and it make some slight improvements w...

integrate my vendor/supplier files from RMS and SBF into Outlook
I want to be able to see my vendor/supplier the same info in outlook, RMS and SBF I hate having to rekey the same information over and over. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Community/NewsGroups/dgbrowser/en-...

Can't use MS-Money with Bank of America???????????
I've used Quicken for a while and am using Quicken2003. I've just gave the new MS-Money2004 trial version a try and I like it better, so I was going to switch...... Until I discovered that Bank of America does not support MS-Money, only Quicken. That sounds crazy to me, but apparently this is the case. If I want to switch from Quicken to MS-Money I will loose the ability to download bank transactions automatically and must use the old fashioned manual download statement method. Does anyone know why a bank as large as Bank America doesn't support MS-Money? Does anyone...

Delay load an MFC extension dll
I have an MFC application with many mfc extension dlls. I would like to delay load some of the nonessential dlls. Is this possible? Yes its very possible. I did it long time ago. The issues were simply related to design of DLLs. Jeff Richter had an article in MSJ few years ago that discussed this for Win32. Same thing works fine. Keep in mind that if you extension dlls have resources that are needed for definition of doctemplates etc, delay loading will not make much sense for those Dlls. ---------- Ajay Kalra ajaykalra@yahoo.com Thanks Ajay. I thought it was possible, but I thoug...

Lost File #2
I have accidently saved over a publisher file and lost all my work. I am aware that I have temp files that may have the data in it but I cannot access any of them. I get an error message saying it is locked or in use by another person but they are not. Can anyone help >-----Original Message----- >I have accidently saved over a publisher file and lost all my work. I am >aware that I have temp files that may have the data in it but I cannot access >any of them. I get an error message saying it is locked or in use by another >person but they are not. > >Can anyon...

Parsing a space delimited file into segments
I have a space delimited file that contains address information. Is there a way to parse each record so that I parse the records into specific portions (Company Name is field 1, Street Address is field 2, etc.)? Using the space as a delimiter doesn't help in this instance because every word is obviously separated by a space. Any help with this would be appreciated. Thanks. hi, you could use the fixed width option but unless all of the data is the same width that could cause a serious problem. i don't know how much data you have but you may have to do it in groups or 1 line a...

3 pst files
I want to have 3 pst files on my Outlook 2003 setup. Is this possible? I have the pst file that I work now and 2 others which are pst files from an old laptop which I want just to be there as separate. How can I do it and shall I do Import or is there any other way. thanks Virginia Don't use the import feature. Simply reconnect the pst-files via; File-> Open-> Outlook Data File... You can place the pst-file in a location that is convenient to you. For instance in a sub folder of your My Documents folder called "Outlook". -- Robert Sparnaaij [MVP-Out...

How do I set up a stacked bar chart using military times?
When my values are time, whenther they are reagular or military, the bottom bar is correct, but the others are not. As anexample, if I want a stacked bar that shows the following 3 times: start work 8:00 lunch 12:30 clock out 16:30 how do I get the bars displayed correctly as well as the "displayed values"? I have just put up a proposed solution for you at:- www.pierrefondes.com - first (top) example on the home page. If my comments have helped please hit Yes. Thanks! "Healthcare Quality Analyst" wrote: > When my values are time, whenther they ar...

Can't open any .exe files
If I click on any programs it pops up and tells me that there is no association. I know how to association a file extension normally. If I click on Excel it gives me the error. Yet if I click on an Excel file then it will open the file. If I click on Notepad gives me the association error yet again if I click on a file saved in Notepad it opens that file. I tried to run System Restore but I get the same error. The exact error message is : This file does not have a program associated with it for performing this Acton. Create an association in the Folder Options control Pane...

unknown cab file required
I just installed Project 2003 and immediately ran the update routine. Office Update tells me that it has SP1 for Project and some new junk mail filters for Outlook 2003. I tell it to download both patches. Download proceeds with no problem. Installation tells me that it cannot find a file called SKU111.CAB. I search all local hard disks - no file. I search the Project disk - no file. I search the Office 2003 disk - no file. I even searched the Publisher 2003 disk (which is not installed). I can account for an SKU13B and an SKU119, but no SKU111. I search all of Microsoft.com - nothing e...

error opening excel file
hi! i cannot open this excel file, an microsoft visual basic window appear saying "An error occur while loading 'Sheet32111111111111111111111111'. Do you want to continue loading the project?" i click yes, microsoft window appear and asking if i want to update this workbook? then i click no a Program Error window appear saying " An error log is being created" what happen to the excel file? the excel file is only 2.6Mb There is a bug in xl97 (fixed in xl2k, IIRC) that allowed worksheet codenames to get too long. I _think_ that newer versions of excel will open...