Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / March 2004

Tip: Looking for answers? Try searching our database.

File saving

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Randy - 14 Feb 2004 10:37 GMT
I've used the Save as-dialog, but I don't know how to set it on the
right disk or file type.

Now the path is c:\Documents and settings\mydocuments
but I want c:\Project
and only the .mdb files

thx
Bongo - 16 Feb 2004 21:43 GMT
8) Hi Randy!

I think that I can help you to solve your problem.
With the following lines you can set a file typ filter
and a default path for saving files (or you can try it
with the below mentioned procedure).

CString DefPath = "C:\\MyProject\\default_file_name";
char MyFilter[] = "Access-Files (*.mdb)|*.mdb||"; /*The string before
the
                                                                     
   first pipe is the text in
                                                                     
   the file type combo-
                                                                     
   box.
                                                                     
   The string behind
                                                                     
   pipe is the filter
                                                                     
   itself.*/

CFileDialog MyDialog(false, "*.mdb", DefPath,
                              OFN_HIDEREADONLY|OVERWRITEPROMT,
MyFilter);

if(MyDialog.DoModal() == IDOK)
{
  ...
}
------------------------------------------------

The second possibility is to edit the entry in the projects string
table.
There you can edit the entry of IDR_MAINFRAME.

Hope that my subscription was helpful.
Bongo - 16 Feb 2004 21:43 GMT
8) Hi Randy!

I think that I can help you to solve your problem.
With the following lines you can set a file typ filter
and a default path for saving files (or you can try it
with the below mentioned procedure).

CString DefPath = "C:\\MyProject\\default_file_name";
char MyFilter[] = "Access-Files (*.mdb)|*.mdb||"; /*The string before
the first pipe is the text in the file type combobox. The string
behind pipe is the filter itself.*/

CFileDialog MyDialog(false, "*.mdb", DefPath,
                              OFN_HIDEREADONLY|OVERWRITEPROMT,
MyFilter);

if(MyDialog.DoModal() == IDOK)
{
  ...
}
------------------------------------------------

The second possibility is to edit the entry in the projects string
table.
There you can edit the entry of IDR_MAINFRAME.

Hope that my subscription was helpful.
Randy - 02 Mar 2004 09:20 GMT
> Bongowrote:

> CFileDialog MyDialog(false, "*.mdb", DefPath,
>                              
OFN_HIDEREADONLY|OVERWRITEPROMT,
MyFilter);

> if(MyDialog.DoModal() == IDOK)
> {
>    ...
> }

The part I set in Bold, doesn't seem to be recognized by Visual C++.
So now my code is

CFileDialog MyDialog(false, "*.mdb", DefPath,
                              OFN_HIDEREADONLY, MyFilter);

but I get now the FileDialog twice. :s

And how do you know which file is selected?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.