April 4th, 1999, 08:52 PM
Iīm creating a simple single-document application using the MFC wizard which for demonstration purposes prints various textmessages in the document window. Those can be selected by a few options in the menu-bar. I tried to implement the handler (something like ON_FILE_NEWMSG) for this Menu-option in the main program (in my case, Demo.cpp). However, to access a function (settext(CString)) I defined in the Document class I guess I need to use a pointer to the document to call the function that will change the text line ( something like ptrtodoc->settext("Hello world"); ).
The problem about this is that I donīt know how to get this pointer. I know that there is a function called CSingledocTemplate that somehow creates and links the mainframe, the view and the document, but this just returns a Pointer to a SingledocTemplate. Besides, Iīm not sure if this pointer is global, so it probably wouldnīt be of any use anyway.
Please help, as this is REALLY beginning to bug me..
The problem about this is that I donīt know how to get this pointer. I know that there is a function called CSingledocTemplate that somehow creates and links the mainframe, the view and the document, but this just returns a Pointer to a SingledocTemplate. Besides, Iīm not sure if this pointer is global, so it probably wouldnīt be of any use anyway.
Please help, as this is REALLY beginning to bug me..