baha
2006-09-14 15:15:02 UTC
I split my view into two separate views. To do so I added the following code
to my OnCreateClient in the main frame.
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
CRect rect;
GetClientRect(&rect);
if ( !m_mainSplitter.CreateStatic( this, 1, 2 ) )
{
TRACE( "Error setting up splitter frames!" );
return FALSE;
}
if ( !m_mainSplitter.CreateView( 0, 0,RUNTIME_CLASS(CViewOne),
CSize(rect.Width()/2, rect.Height()), pContext ) )
{
TRACE0( "Error setting up splitter frames!" );
return FALSE;
}
if ( !m_mainSplitter.CreateView( 0, 1, RUNTIME_CLASS(CViewTwo),
CSize(rect.Width()/2, rect.Height()), pContext ) )
{
TRACE0( "Error setting up splitter frames!" );
return FALSE;
}
m_bInitSplitter = TRUE;
return true;
}
My problem is that I'd like to share date between ViewOne and ViewTwo. In
particular I have a data structure in ViewOne which I use to redraw ViewOne
every time a timer fires. I'd like to display the data in my ViewOne's data
strcture in ViewTwo every time ViewOne redraws. How do I go about doing this?
Thanks
to my OnCreateClient in the main frame.
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
CRect rect;
GetClientRect(&rect);
if ( !m_mainSplitter.CreateStatic( this, 1, 2 ) )
{
TRACE( "Error setting up splitter frames!" );
return FALSE;
}
if ( !m_mainSplitter.CreateView( 0, 0,RUNTIME_CLASS(CViewOne),
CSize(rect.Width()/2, rect.Height()), pContext ) )
{
TRACE0( "Error setting up splitter frames!" );
return FALSE;
}
if ( !m_mainSplitter.CreateView( 0, 1, RUNTIME_CLASS(CViewTwo),
CSize(rect.Width()/2, rect.Height()), pContext ) )
{
TRACE0( "Error setting up splitter frames!" );
return FALSE;
}
m_bInitSplitter = TRUE;
return true;
}
My problem is that I'd like to share date between ViewOne and ViewTwo. In
particular I have a data structure in ViewOne which I use to redraw ViewOne
every time a timer fires. I'd like to display the data in my ViewOne's data
strcture in ViewTwo every time ViewOne redraws. How do I go about doing this?
Thanks