Open/Save File Dialog and other dialog issues

Started by
6 comments, last by GameDev.net 19 years, 6 months ago
Hiya, I'm currently trying to create a user interface for a lighting tool that I have created and there are several issues that I am having with the dialog boxes. Firstly I cannot use the common dialog box for the file open/save dialog because i am not using MFC. Whenever I try to compile the compiler complains about stdafx.h being included. Is there any way I can get a file open/save dialog box without using MFC and stdafx.h? I also wanted to use a calender dialog box, where the user can select a date from the calender, I can find the calender-month object from Visual Studio's (VC++ 6) dialog box editor, but i don't know how to control the object, when i activate the dialog box the calender-month object is not visible, do I need to set any initialisation parameters for the calender-month object, how do i find out which date is selected when the user clicks the OK button? Thanks in advance for any help or advice you may have about my problems.
Advertisement
Just turn off precompiled headers for your project, it's possible to use the common dialogs for open/save file in a Win32 application - here's a tutorial on using the Open/Save file dialogs.
I'm not using pre-compiled headers, but thanx for the link theres wome wkd tutorials there! Ne other ideas as to why this doesn't work, i've got it to work at uni, which has VC++6 Professional, I only have standard, could that be the problem?

Cheers
Date and Time Picker Controls should help you to use your calender-month control.

What is the exact error you are receiving?
Your precompiled header problem has to do with the project settings. In MSVC 6.0, to disable precompiled headers, goto Project Settings (Alt+F7) -> C/C++ tab -> Precompiled Headers category, and select "Not using precompiled headers". stdafx.h is only used my MSVC's precompiled headers, so if you see an error involving it, you can be sure that precompiled are the problem.
I have that option turned off, Im definately not using pre-compiled headers. It is complaining that windows.h is being included and that MFC applications must not include windows. I checked the settings for the project and i have not using MFC and not using Pre-Compiled Headers selected - and it still doesn't work!
You can't use MFC classes outside of MFC.

Try using GetOpenFilename/GetSaveFilename, CFileDialog uses those under the hood anyway.

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

I tried using the OpenFileDialog and SaveFileDialog, but to get those to work i need to include stdafx.h, is there a different header that i can include that contains the open file/save file dialog? Cheers

This topic is closed to new replies.

Advertisement