Click here to Skip to main content
16,007,885 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: String Conversion Pin
Dominik Reichl8-Sep-03 7:01
Dominik Reichl8-Sep-03 7:01 
GeneralRe: String Conversion Pin
David Crow8-Sep-03 7:19
David Crow8-Sep-03 7:19 
GeneralRe: String Conversion Pin
Frank Deo8-Sep-03 7:38
Frank Deo8-Sep-03 7:38 
Generalmultiple return values Pin
manusha8-Sep-03 6:45
manusha8-Sep-03 6:45 
GeneralRe: multiple return values [C#] Pin
Dominik Reichl8-Sep-03 7:04
Dominik Reichl8-Sep-03 7:04 
GeneralUDP client implementation Pin
NewHSKid8-Sep-03 6:39
NewHSKid8-Sep-03 6:39 
GeneralRe: UDP client implementation Pin
geo_m9-Sep-03 7:40
geo_m9-Sep-03 7:40 
GeneralDocument/view stops working with CSplitterWnd... Pin
iNsAn1tY8-Sep-03 6:05
iNsAn1tY8-Sep-03 6:05 
Hi. This my first post here, so be gentle Smile | :)

I'm creating a level editor, in the vein of id Software's q3radiant, and I've hit a snag. I've been developing it for about 3 months, using MFC/C/C++, and haven't had the need to save any of the maps I've been making. Now I'm coming to the part where I have to be able to save and load my maps to progress. "All well and good," I thought. "I'm using the document/view architecture, it shouldn't be too much trouble." I was wrong, apparently.

I've created some window classes to provide the 2D and 3D functionality I need (they use OpenGL for rendering), and then used a couple of static CSplitterWnds to make the windows. This has worked perfectly up to now. There is a texture window (CTexWnd : CWnd) on the right, and then a nested CSplitterWnd on the right with three 2D windows (C2DWnd : CWnd) and a perspective window (C3DWnd : CWnd). I haven't used the view or document created by the app wizard (CMyEditorView and CMyEditorDoc, respectively), as the need hasn't arisen until now.

I've come to save my maps, but the Save and Save As menu items are greyed. The resource IDs (ID_FILE_SAVE and ID_FILE_SAVE_AS) are correct, but they're still unusable. I created a small test program, and dug around in MFC until I found out the problem: I wasn't creating a CMyEditorView, and therefore, the messages weren't being routed to my CMyEditorDoc. I created a CMyEditorView in place of one of 2D windows, and, lo and behold, the Save and Save As buttons were available. However, now I'm confused. How do I link the document to all of the windows, or none of them? How do I link it so that the document can be used to store my map, and save/load it? I have to keep using C2DWnd instead of CMyEditorView, but it would seem that's not an option. Is there any way I can get out of this sticky problem, and save/load my maps using the document? I think there's other modelling software which uses the SDI environment and splitter windows, but still uses the document/view architecture. Thanks in advance for any replies, and thanks for reading this rather large post, but I thought I'd probably better get in as much detail in possible Big Grin | :-D

PS. I can post code and/or screenshots, if it's relevant...

Chris Mantle
GeneralRe: Document/view stops working with CSplitterWnd... Pin
iNsAn1tY8-Sep-03 23:20
iNsAn1tY8-Sep-03 23:20 
GeneralCD ROM detection Pin
Nigel Gooch8-Sep-03 5:54
Nigel Gooch8-Sep-03 5:54 
GeneralRe: CD ROM detection Pin
David Crow8-Sep-03 8:03
David Crow8-Sep-03 8:03 
GeneralRe: CD ROM detection Pin
Nigel Gooch8-Sep-03 21:39
Nigel Gooch8-Sep-03 21:39 
Generalattach the dialog to the tab Pin
Jeef8-Sep-03 5:33
Jeef8-Sep-03 5:33 
GeneralRe: attach the dialog to the tab Pin
Jeef8-Sep-03 16:06
Jeef8-Sep-03 16:06 
Generalerror in executing c++ code Pin
ranjjj8-Sep-03 4:58
ranjjj8-Sep-03 4:58 
GeneralRe: error in executing c++ code Pin
David Crow8-Sep-03 5:43
David Crow8-Sep-03 5:43 
GeneralRe: error in executing c++ code Pin
Michael P Butler8-Sep-03 6:07
Michael P Butler8-Sep-03 6:07 
GeneralRe: error in executing c++ code Pin
ranjjj8-Sep-03 18:09
ranjjj8-Sep-03 18:09 
GeneralRe: error in executing c++ code Pin
Michael P Butler9-Sep-03 9:34
Michael P Butler9-Sep-03 9:34 
GeneralChange color group box border Pin
JensB8-Sep-03 4:33
JensB8-Sep-03 4:33 
GeneralRe: Change color group box border Pin
valikac8-Sep-03 9:57
valikac8-Sep-03 9:57 
GeneralRe: Change color group box border Pin
JensB9-Sep-03 2:24
JensB9-Sep-03 2:24 
GeneralRe: Change color group box border Pin
valikac9-Sep-03 20:04
valikac9-Sep-03 20:04 
GeneralCPen with thick dotted lines Pin
BadJerry8-Sep-03 3:31
BadJerry8-Sep-03 3:31 
GeneralRe: CPen with thick dotted lines Pin
David Crow8-Sep-03 4:15
David Crow8-Sep-03 4:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.