Generating a Load File Dialog

I'm writing a simple OGL game in MFC. I need to implement a load and 
save game feature and i thought I would use the standard windows load 
and save dialogs. I can't seem to do this; could you please advice the 
best course of action.

My application does not employ the document architecture as I thought 
this wouldn't be necessary considering only one savegame is open any any 
one time. I would rather not have to learn about and implement the 
document architecture but from what I've read/tried I'm being to believe 
that you have to use it in order to generate this load/save dialogs.

The other alternative i looked into was CFileDialog but I don't know 
where to get information on using this method or even know if this will 
work without the document architecture.

Thanks in advance,

oLE
0
ole_v2 (2)
1/28/2005 4:39:17 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
515 Views

Similar Articles

[PageSpeed] 46

oLE wrote:
> The other alternative i looked into was CFileDialog but I don't know 
> where to get information on using this method or even know if this will 
> work without the document architecture.
> 
> Thanks in advance,
> 
> oLE

CFileDialog is what you are looking for, and it will work fine without 
the document/view architecture.  The answer to "where to get 
information" is always MSDN (push F1).  Type in "CFileDialog" in MSDN 
and read the help and follow the relevant links.  Then you can post a 
question asking about whatever you don't understand.  But you have to 
learn to look something up in the built-in help before you can do much else.

-- 
Scott McPhillips [VC++ MVP]

0
Scott
1/28/2005 8:56:33 PM
Scott McPhillips [MVP] wrote:
 > oLE wrote:
 >
 >> The other alternative i looked into was CFileDialog but I don't know
 >> where to get information on using this method or even know if this
 >> will work without the document architecture.
 >>
 >> Thanks in advance,
 >>
 >> oLE
 >
 >
 > CFileDialog is what you are looking for, and it will work fine without
 > the document/view architecture.  The answer to "where to get
 > information" is always MSDN (push F1).  Type in "CFileDialog" in MSDN
 > and read the help and follow the relevant links.  Then you can post a
 > question asking about whatever you don't understand.  But you have to
 > learn to look something up in the built-in help before you can do much
 > else.
 >

Yeah i think i was just scared of it anyway I included afxdlgs.h and 
wrote this:

	CFileDialog savegame(							
		FALSE,
		"jsg",								
		current.playername,
		OFN_HIDEREADONLY,
		"Jobber Savegames (*.jsg)|*.jsg||",
		this
	);
	savegame.DoModal();

and hey presto a dialog box. Anyway only a small problem now, just me 
being picky really. I'd like to pass a rect struct to the dialog somehow 
and have it appear at a location i define instead of in the middle of 
the owner window which it is now. Only thing is the OPENFILENAME struct 
which contains all the data for the creating of the dialog doesn't have 
anything.

I was wondering if there is a function which can move a window after its 
being created or maybe another more elegant way perhaps.

Chars,

oLE
0
ole_v2 (2)
1/30/2005 4:28:17 PM
Reply:

Similar Artilces:

Sequential Number Generator, Saving, and Linking
Hello, not totally familiar with Excel and trying to accomplish th following within our sales department: 1. We have two basic Excel files that we have to access on a share drive every time we issue a quotation: FILE A: This is an Excel quotation form already built. FILE B: This lists out the existing quotations that have been issued listed by reference number. It includes basic fields like 'Sale Person', 'Product' and 'Date', etc. Every time we issues a quote we fill out the nessary information i FILE A, reference FILE B to determine the next sequential number. W s...

How do you open PDF files with Word 2007?
I must figure out how to open PDF files in Word 2007. I am taking on line classes and work is shared in PDF format. I have a new Dell Inspiron laptop that came loaded with Windows 7. I have had it a week and need help. I tried to download the Microsoft PDF add on, but it did not work. I can only read code when I open incoming PDF files. The default program is listed as Word. What am I doing wrong? You don't. You need a PDF reader, the most common being Adobe Acrobat Reader which you can download for free. It is huge and has some clever tools, but if you only want to read th...

Can't open NRL Files (.nrl)
Hi all I can't open 4 e-mails containing attachments, the Types Of File are NRL File (.nrl). I don't know how to open or how to look at the attachments, If anyone can help me that would be great. Thank you for your time reading this. "Wolfhorn" <Wolfhorn@discussions.microsoft.com> wrote in message news:414B5A7D-8BD5-4476-9679-F2751B0F70FB@microsoft.com... > Hi all > I can't open 4 e-mails containing attachments, the Types Of File are NRL > File (.nrl). > I don't know how to open or how to look at the attachments, If anyone can > help me that w...

format problem importing quicken files from Bank
Hi I have Money 2001 never used it until today. I am in Italy and my bank allows me to export bank statement in a quicken file. However when I import it into money - money misreads the format and takes the first punctuation mark as the decimal point. i.e. the amount euro 1.234,56 imports as 1,23 euro's instead of one thousand euros. My regional settings are set to italian with , being the decimal and . being a separator - however money takes the first , or . as the decimal Any ideas on how to fix this? regards Ski ...

Dialog, Custom Controls and Extension DLLs...
I am trying to convert our DLLs from Regular to Extension, and I ran into a problem where Create() is now failing for one of my dialogs. I've narrowed it down to the fact that this dialog has a custom control. The custom control class is imported from a DLL. Here is the scenario in more detail: In DLL1, I have the dialog and code that tries to create it... class Dialog { CustomControl customControl; }; void onSomeMessage() { Dialog.Create(IDD_OF_A_DIALOG_RESOURCE_DEFINED_IN_DLL1); } In DLL2, I have an exported custom control that looks like this... class DLL2_API CustomContr...

unable to read file with "xlw" extension
I have an old but very important file with a "xlw" extension which I cannot open with Excel. When I tried to open it, some error message came up indicating the file cannot be accessed, as though the file is not there. Any idea? Sounds like a workspace file, which contains information about workbooks, but not the workbooks themselves. So the workbook files may not be able to be accessed... You'll need to find the workbook files. From XL Help ("Save a group of workbooks in a customized workspace") > You can open a group of workbooks in one step by creating a work...

received .pub file but don't have program to open it.
How do I know which version of publisher to get to open a file .pub I was sent. It contains a business card but I dont want to buy a full new version if it was created on an older version. Do you have Publisher? What version? What happens when you try to open it? Do you have Norton? Might disable "script blocking" in Norton and in Norton options, misc., disable Office Plug-in. If you still have no luck send the file to me and I will convert it to your version. gsauer at columbus dot rr dot com -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://...

Opening .xls file "outside" Excel not showing
Hi all. This is kind of weard, but here it goes: when I open workbook from Excel (file -> open) it works just fine, but... When I'm trying to open the same workbook via "link", for example double clicking the file from windows explorer -> Excel opens, but the file is not visible. And when I choose: view -> full screen -> it comes visible. Do you have any idea what is wrong? System is Win XP pro and Office XP. This happens to all .xls files... TIA Regards, Alfred Hi Alfred, Try the following steps: 1. Exit Excel 2. From Start, Run. Enter the command: "excel...

modeless dialog boxes and z order
My dialog based app creates several modeless dialogs. I want the window with focus to always be on top. So I want the modeless dialogs on top when activated. I want the main window on top when it is activated (click on it). I know this is contrary to standard behavior. I also know I may end up with hidden windows and have a plan. At this point however I cannot find a way for a modeless dialog to be below the window that created it. I have tried many different calls to SetWindowPos but somehow either MFC or Windows overrides these. Any help greatly appreciated. -- Charlie This...

Corel Quattro file Coversion Help
I am attempting to convert multiple large linked Corel Quatro spreadsheets to Excel. Does any one know of a converter? I have tried using Microsofts pubilshed converter for Excel 2000. However everytime I attempt to open a Quattro .wb3 file with the converter it locks excel up. Any ideas????? ...

Problem generating email address
I have Exchange2003 and Win2003 AD with about 20 child domains running. Now I am experiencing some problem. For one child domain, RUS runs fine and I actually manually did update on RUS. The child domain is located in different geograpgic place and working fine. One word, I don't see any system issue. I created a few new users' email a week ago, by going through the "Exchange Task" process. However, none of their email address is generated. I rebooted email server and child DC. Still the email address is not generated. Any help? Thanks Rick The email addresses a...

Microsoft Office 2004
Hi I have been using the microsoft office 2004 on an ibook G4 on panther for the last 6 months. Recently, it is refusing to read some of the excel and powerpoint file created on a PC under the Office 97. I can see the file name but not the icon next to it when I look under Finder. When I click on the file name, the file disappears from view completely. At first I thought it was a software issue so I re-install the Microsoft Office 2004, but the problem persists. Has anyone encountered this problem? Any suggestions to solve it would be much appreciated. Thanks in advance, June In artic...

Is a XML file Does not Support XSL and XSD operation together.
Dear Experts, Check out the following XML, XSl and XSD document. If i use XML file without XSD defination it applies XSL style and If i include the XSD document. Nothing is getting displayed in the browser. Is that mean XSL and XSD can not be apply together on a XML file. ? or I am doing something wrong ? Thanks Samir --- ---- XML Document --------- <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" href="ch_5_NewsPaper_Style_1.xsl"?> <!-- <NEWSPAPERDATA xmlns="http://tempuri.org/ch_5_NewsPaper_Styl...

scanost can not open file
I used to be connected to a Microsoft Exchange Server & therefore my Outlook works off an .ost file. However I no longer work for that company so I cannot link to the Exhange Server. However my .ost file has become currupt some how & I've tried running scanost.exe directly by going through program files, but it will not let me run it as it says that Outlook is not closed or some program that uses Outlook is running & therefore will not scan the .ost file. Has anyone a idea of what I can do please? Eddie If you are no longer connecting to the Exchange server, w...

Can OfficeX open MS Publisher files?
Does anyone know of a way that OfficeX can open or translate files created in Publisher? It is the one thing that I really miss and need when working back and forth between my G4 and PC files. On Sun, 28 Sep 2003 15:06:23 -0700, "Natalie" <natalie@mcgrathalaska.net> wrote: >Does anyone know of a way that OfficeX can open or >translate files created in Publisher? It is the one thing >that I really miss and need when working back and forth >between my G4 and PC files. AFAIK you're SOL... ("As far as I know you're shit outta luck") to open ...

How to open external host application for a file type
Hi, I have an MFC application managing various document types pdf, doc etc. When the user selects 'view' i want to open the external application that is associated with this file type( passing it the path to the selected document). I understand there is a API to do this? Could someone please give me an example or a link on how to do it? Thankyou very much. "PRMARJORAM" <PRMARJORAM@discussions.microsoft.com> wrote in message news:C072DB20-7105-4DB8-A3F0-ADF12D073DC2@microsoft.com... > Hi, > I have an MFC application managing various document types pdf, doc ...

leading zeros lost when opening a .csv file
I am looking for a way to let Excel know that zip code in a .csv file should be treated as text. Excel treats a zipcode as a number and discards any leading zeros. I have tried the following methods to no avail: A blank before or after the zipcode (they are discarded) Chr$(0)s are discarded too A single quote prefixed to the zipcode (works but is left in the field) Is there a way to let Excel know that a value is actually text in a .csv file? When you open the .csv file Excel probably just opens it up automatically (not too sure on this can't remember). If it does, change the .c...

Mail User Profile and Data Files
My Outlook 2007 no longer start and I believe it is the outlook pst file that has been coorupted. I have deleted the profile from the Mail control panel icon and started with new profile. Outlook start well asking me my various info to set up the email service. Everything is fine to taht point but the minute I try to setup the data files (pst formoat either) I get the fol msg. This information service is not install on your computer. The next box dialogue box from Outlook at startup is: Either there is no default mail client or the current mail client cannot fulfill the...

Saving sent files
I have XP. I've looked but, can't find an option for this. I would like to choose which sent e-mails get saved and which ones do not. I only see an option to either auto save all or none. Is it possible to get a pop-up question as I send e-mails asking if I want to save it? Thanks Nope, but you can set the options for the individual message not to save the message when sending -- Roady [MVP] www.howto-outlook.com Tips of the month: -Creating Signatures -Create an Office XP CD slipstreamed with Service Pack 3 ----- "Angela N." <anonymous@discussions.microsof...

message map in .h file?
Hello, I am having a problem with message maps. I am trying to create re-usable class as just a header file so I can #include it without having to add it to the project. The problem comes when I need to get, for example, OnChar(). It doesn't work without the message map, and DECLARE_MESSAGE_MAP() and the message map itself bring on many linking errors. Can anyone tell me how to do this? Thank you D What kinds of errors did you meet? I think you can do everything in header file.. Just make sure you make pair DECLARE_MEESAGE_MAP() and BEGIN_MESSAGE_MAP/END_MESSAGE_MAP() etc... "D...

Saving Files Opened as Read-Only
Can an Excel file opened as read-only be made read-write while it is open ? Preferably through VBA In Lotus 1-2-3 there was an option to open a file "without reservation" making it read-only. After making edits the reservation could be requested & if the file hadn't changed & no one had reservation the file was changed to read-write access & could be saved as the original file name I'm not real familiar with the share feature of Excel but it looks like it leaves the door open to losing edits. How was the file marked readonly? Via the OS? Or File|SaveAs|T...

Smartinet.ini file issue
Has anyone had the error message "Money encountered an error processing the download file smrtinet.ini". Apparently, the problem disables my ability to update Money. It was present for a long time, stopped for a few downloads and then started to show up again. Appreciate the guidance. In less time reading threads than you spent posting, you would have found the thread "error msg when downloading from internet" dealing with this. "Cesco" <anonymous@discussions.microsoft.com> wrote in message news:117ce01c3f4fe$e2cef3b0$a401280a@phx.gbl... > Has a...

How can I resize/restore the File > Save As window?
Somehow I have managed to expand the File | Save As window such that it now fills the whole screen. This only affects Excel (2007). There is no minimise button, and I cannot see the bottom RH corner to grab it and resize the window and I cannot get hold of any edge of the window to move it. How can I resize/restore the File > Save As window? TIA. Chris. Try double-click on the Title Bar Gord Dibben MS Excel MVP On Fri, 4 Dec 2009 16:18:15 -0000, "Chris Mitchell" <chris.a.mitchell@NOSPAMbtinternet.com> wrote: >Somehow I have managed t...

How can I reduce the file size of my Word Form?
Hello; I hope this is posted to the appropriate group. If not can you please tell me where I should post this question? I have a form with some protected sections that is seventeen pages long. The protected sections contain a lot of tables with calculated fields. Before it is filled in the file is 5.48 MB. After it is completed it can be much longer and grow exponentially in size. I have received calls from staff members who say the file grows so large that it takes a long time to save (five minutes at times), sometimes Word crashes and they have a hard time attaching ...

Error Error my framework is not loading
Help, just installed Office / Mac 2004 for word...... every time I open it I = get an=20 error of "problem loading the framework library?" HELP ! Any thoughts Thanks in advance Larry Hi Larry: See here: http://support.microsoft.com/default.aspx?scid=kb;EN-US;321386 Regards On 28/9/04 2:54 AM, in article 21fe01c4a4b2$b967d460$a501280a@phx.gbl, "anonymous@discussions.microsoft.com" <anonymous@discussions.microsoft.com> wrote: > Help, > just installed Office / Mac 2004 for word...... every time I open it I get an > error of "problem loading the fr...