GDI question 
Author Message
 GDI question

I have a class defived from CWnd which I instantiate and
call Create inside OnOk of a dialog function, like this

CMFCChart coChart; // CMFCChart is derived from CWnd

coChart.Create(_T("STATIC"), "", WS_CHILD | WS_VISIBLE | WS_BORDER, CRect(
0,0 100, 100 ), this, 0);

But the window is never drwan ( no border appears) and its OnPaint function
is never called
( I put a breakpoint on the opening brace and it does not stop )

Is WM_PAINT sent to its parent?
If yes, how can I reflect it with ON_NOTIFY_REFLECT or other message?



Tue, 13 Sep 2005 17:34:47 GMT  
 GDI question
After you call coChart.Create(...), are you then calling CDialog::OnOK()?
This would destroy the dialog, and thus the coChart object would no longer
have a parent.


Quote:
> I have a class defived from CWnd which I instantiate and
> call Create inside OnOk of a dialog function, like this

> CMFCChart coChart; // CMFCChart is derived from CWnd

> coChart.Create(_T("STATIC"), "", WS_CHILD | WS_VISIBLE | WS_BORDER, CRect(
> 0,0 100, 100 ), this, 0);

> But the window is never drwan ( no border appears) and its OnPaint
function
> is never called
> ( I put a breakpoint on the opening brace and it does not stop )

> Is WM_PAINT sent to its parent?
> If yes, how can I reflect it with ON_NOTIFY_REFLECT or other message?



Tue, 13 Sep 2005 18:57:56 GMT  
 GDI question
after I posted it I realized that was the problem;
thanks anyway



Quote:
> After you call coChart.Create(...), are you then calling CDialog::OnOK()?
> This would destroy the dialog, and thus the coChart object would no longer
> have a parent.



> > I have a class defived from CWnd which I instantiate and
> > call Create inside OnOk of a dialog function, like this

> > CMFCChart coChart; // CMFCChart is derived from CWnd

> > coChart.Create(_T("STATIC"), "", WS_CHILD | WS_VISIBLE | WS_BORDER,
CRect(
> > 0,0 100, 100 ), this, 0);

> > But the window is never drwan ( no border appears) and its OnPaint
> function
> > is never called
> > ( I put a breakpoint on the opening brace and it does not stop )

> > Is WM_PAINT sent to its parent?
> > If yes, how can I reflect it with ON_NOTIFY_REFLECT or other message?



Tue, 13 Sep 2005 19:14:31 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Help with some GDI questions

2. Next dumb GDI question

3. DIB and GDI questions...

4. Simple GDI Question

5. GDI Question

6. GDI Question

7. Win32 GDI questions..

8. Default GDI font questions

9. 2 Questions about GDI

10. question about copying 16-or-256 GDI bitmap object to monochrome bitmap object by bitblt

11. GDI newbie question

12. GDI mapping question

 

 
Powered by phpBB® Forum Software