I need to be able to call methods in two view classes in a splitter window. The objective is to have events from one pane call method of the view class in the other pane. I need to be able to do this both ways (both the panes call methods from the other pane).
I have changed this project in order to achieve this, by replacing the RightViewFrame with a RightPaneView (inherits from CFormView).
I now have a splitter window and declare a pointer in one view class, that points into the other view class (as in this project, the pointer is initialised in the OnCreateClient method in the CMainPFrame). In this way, I can call methods belonging to the view in the right side using the pointer defined in the view on the left pane. I have one way communication.
But then, I declare the pointer in the view at the right with the same type as the class in the left and the project does not compile. I can not have two view classes with pointers to each other. What am I doing wrong? How else can I call methods from one pane to the other?
I have a major problem with this framework. If you insert items into the list control until it needs more rows than the pane has, or if you reduce the pane height so that it is less than the data rows, the pane loops, repeatedly trying to paint, with a vertical scrollbar that disappears and re-appears.
When I click "New document" button in toolbar, an error occured , that because
m_ImageList.Create(IDB_IMAGES, 16, 1, RGB(255, 0, 255)); //Creare Image list twice
I ran your example real nice but I want to write everything from scratch so that I know whats going on. The first thing you said was to edit this fuction
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext*
Now where this function is I have no idea and I don't think it will work if i just make one. So what I have done so far is created a generic program through a VC++ wizard that is mutlitple documents (u have the option of single, multiple, and dialog based.) I found the header and cpp files for CMainFrame but this function does not exists. So Can I just make it or what did I do wrong?
I developed a SDI application in the Outlook-Style; That is a database based application. I have a View "COutlookView" with Buttons to the left, and to the right a CRiPaneFrame from CFrameWnd; It includes many views (some are with a StaticSplitter), they switched after klicking on buttons in COutlookView.
The switching of the Views without Data works perfect. However, as soon as I open a database the First View stay visible in the backround. And the other ones can not be paint correctly.
I don�t have so much experience with VC++; And i hope telling me, where I have to pay attention with such problems.
I thank ahead.