Click here to Skip to main content
15,923,168 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: A decent project for a newbie? Pin
CaptainChainsaw22-Jun-06 10:10
CaptainChainsaw22-Jun-06 10:10 
Questionmemcmp and UNICODE_STRINGS? Pin
Glich21-Jun-06 11:20
Glich21-Jun-06 11:20 
AnswerRe: memcmp and UNICODE_STRINGS? Pin
Michael Dunn21-Jun-06 11:46
sitebuilderMichael Dunn21-Jun-06 11:46 
GeneralRe: memcmp and UNICODE_STRINGS? Pin
Glich22-Jun-06 10:09
Glich22-Jun-06 10:09 
QuestionMultiple Views for SDI Pin
DanYELL21-Jun-06 11:12
DanYELL21-Jun-06 11:12 
AnswerRe: Multiple Views for SDI [modified] Pin
led mike21-Jun-06 11:25
led mike21-Jun-06 11:25 
GeneralRe: Multiple Views for SDI Pin
DanYELL21-Jun-06 12:03
DanYELL21-Jun-06 12:03 
GeneralRe: Multiple Views for SDI Pin
led mike21-Jun-06 18:51
led mike21-Jun-06 18:51 
DanYELL wrote:
Is there away to redo that code
in MainFrm.cpp so that the View remains and that data remains
from screen to screen?


Of course there is but there are other ways that are a better design. The Model View Controller[^] Design Pattern is preferred. MFC Document/View is much like MVC. In MVC the "Model" is a "Data Model". This can mean an Object structure that represents the Data for the application and it's relationships.

A primary design principle of MVC is that "Views" do not maintain the application data. This way the "View" classes uphold the "isolation" principle since they do not require any relationships. Of course the same is true for the "Serialization" code, it can exist in isolation from the "Views" and the "Controller" logic.

In MFC Doc/View the Document class can be used as the interface to the "Model". So if a "View" provides a user interface for the user to enter data, at the appropriate time the data is routed into the "Model" for storage. Then all the "Views" have access to the Data through the "Model". Note: "The appropriate time" is application dependent and associated to one or more events.

In some MFC applications the Document class "is" the Model. In others it just provides an entry point or "interface" into the Model. Regardless of any specific implementation the Document class can then access the Data for the purpose of Serialization (Save/Load).

So you need to know (analysis) when, what event(s), you should use to trigger routing the view(s) data through or into the CDocument class. Then when you need to "Save" the data is all available to the CDocument class for Serialization. When you "Load" the CDocument class handles Deserialization and initializes the data from the persisted storage. Then of course the "Views" can display the data by getting it from the CDocument class.

I hope that helps


"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?"
Colin Angus Mackay in the C# forum


led mike
Questioncharacter included in font ? Pin
wolpers21-Jun-06 10:51
wolpers21-Jun-06 10:51 
AnswerRe: character included in font ? Pin
bob1697221-Jun-06 11:51
bob1697221-Jun-06 11:51 
Questionproblem with trnasferring a exe file using socket Pin
ku1983200121-Jun-06 10:42
ku1983200121-Jun-06 10:42 
AnswerRe: problem with transferring a exe file using socket Pin
Glich21-Jun-06 11:32
Glich21-Jun-06 11:32 
GeneralRe: problem with transferring a exe file using socket Pin
ku1983200121-Jun-06 12:13
ku1983200121-Jun-06 12:13 
Question"Edit" part of MFC menu. Pin
tingu21-Jun-06 9:22
tingu21-Jun-06 9:22 
QuestionRe: "Edit" part of MFC menu. Pin
David Crow21-Jun-06 9:38
David Crow21-Jun-06 9:38 
AnswerRe: "Edit" part of MFC menu. Pin
tingu21-Jun-06 9:50
tingu21-Jun-06 9:50 
GeneralRe: "Edit" part of MFC menu. Pin
David Crow21-Jun-06 10:13
David Crow21-Jun-06 10:13 
AnswerRe: "Edit" part of MFC menu. Pin
Hamid_RT21-Jun-06 19:35
Hamid_RT21-Jun-06 19:35 
QuestionOwnerdraw CProgressCtrl with XP Themes Pin
madmax000121-Jun-06 8:47
madmax000121-Jun-06 8:47 
AnswerRe: Ownerdraw CProgressCtrl with XP Themes Pin
Michael Dunn21-Jun-06 8:54
sitebuilderMichael Dunn21-Jun-06 8:54 
GeneralRe: Ownerdraw CProgressCtrl with XP Themes Pin
madmax000121-Jun-06 9:09
madmax000121-Jun-06 9:09 
GeneralRe: Ownerdraw CProgressCtrl with XP Themes Pin
Michael Dunn21-Jun-06 13:51
sitebuilderMichael Dunn21-Jun-06 13:51 
GeneralRe: Ownerdraw CProgressCtrl with XP Themes Pin
madmax000121-Jun-06 22:06
madmax000121-Jun-06 22:06 
GeneralRe: Ownerdraw CProgressCtrl with XP Themes Pin
Michael Dunn22-Jun-06 8:04
sitebuilderMichael Dunn22-Jun-06 8:04 
QuestionCstring to char * error Pin
kitty521-Jun-06 8:07
kitty521-Jun-06 8:07 

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.