How I Can use 1 document which can be accessed by multiple views in SDI app.
-
Hi There, I want to know how I can support multiple ‘FormViews’ by having a single ‘Document’ class in my ‘SDI’ Application. The class which ‘MFC Wizard’ makes it for us supports the document. But the additional ‘FormViews’ which I put in doesn’t have access to the ‘Documents’ variables. The code which I tried my self are as follows: These are the additional or the ‘Nth’ classes Class CSection : public CFormView { … }; void CSection:: OnInitUpdate(void) { CMyDoc* pDoc = (CMyDoc*) GetDocument(); This code works in an SDI application in which classes are derived from ‘CRecordView’. } void CCourse:: OnInitUpdate(void) { CMyDoc* pDoc = reinterpret_cast (GetDocument()); }
-
Hi There, I want to know how I can support multiple ‘FormViews’ by having a single ‘Document’ class in my ‘SDI’ Application. The class which ‘MFC Wizard’ makes it for us supports the document. But the additional ‘FormViews’ which I put in doesn’t have access to the ‘Documents’ variables. The code which I tried my self are as follows: These are the additional or the ‘Nth’ classes Class CSection : public CFormView { … }; void CSection:: OnInitUpdate(void) { CMyDoc* pDoc = (CMyDoc*) GetDocument(); This code works in an SDI application in which classes are derived from ‘CRecordView’. } void CCourse:: OnInitUpdate(void) { CMyDoc* pDoc = reinterpret_cast (GetDocument()); }
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q141/3/33.asp&NoWebContent=1[^] Michael But you know when the truth is told, That you can get what you want or you can just get old, Your're going to kick off before you even get halfway through. When will you realise... Vienna waits for you? - "The Stranger," Billy Joel