Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with CFormView

Status
Not open for further replies.

markitus

Programmer
Apr 12, 2005
10
PL
well, this is for me quite complicated problem, i don't even know how to start explaining.
Well, i got a program with a splitter window, one of them is the view, and the other one a formview with buttons for controlling the view. this is the code that describes what i mean:
Code:
BOOL CMainFrame::OnCreateClient( LPCREATESTRUCT ,
	CCreateContext* pContext)
{	
	if (!m_wndSplitter.CreateStatic(this, 1, 2))        
		return FALSE;    

	if (!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CMy3DspineView),CSize(500,10),pContext)) 
	{        
		m_wndSplitter.DestroyWindow();        
		return FALSE;    
	}  

	if(!m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(graphics_c),CSize(10,10),pContext))
	{        
		m_wndSplitter.DestroyWindow();        
		return FALSE;    
	}    


	
	return TRUE;
}

with this no problems. I'm programming using opengl( but this is not a important fact). Initially there's an image loaded on the view. In the formview, i got a 'play' button that must start an animation, so this image should start moving.
My problem is that when i click on the button the movement doesn't start unless i minimize the window and maximize it back. What could i do to make it automatically?
here's my code on the Cformview class when clicking the button. the flag sp.active is a public variable from a class that represents my image:
Code:
void graphics_c::OnPlay() 
{
	// TODO: Add your control notification handler code here
	
	sp.active=true; //flag for start moving.
}

and here my OnPaint function in the view class:
(i've deleted all the lines concerning opengl functions as they are not relevant)
Code:
void CMy3DspineView::OnPaint() 
{
	CPaintDC dc(this); // device context for painting
	
	// TODO: Add your message handler code here



	if(sp.active)
	{

	
		sp.DrawPoints(m_height,m_width,p );
		
		
	
	}
	
	
	// Do not call CView::OnPaint() for painting messages
	
	
}

what can i do to solve this?

thank u so much, i'll be looking forward for ur answers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top