Re: Window Refresh in OnPaint()
The parent class (dialog) is CVisuBar. The static control (a control
derived from CStatic) is defined as a member variable(m_wndChild) ..
and the following code is used to create it .. I have created several
other controls, "CEdit", "CRichEditCtrl" and they all seem to work with
no probs ..
CVisuBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CSizingControlBarG::OnCreate(lpCreateStruct) == -1)
return -1;
SetSCBStyle(GetSCBStyle() | SCBS_SHOWEDGES | SCBS_SIZECHILD);
if (!m_wndChild.Create(NULL,
WS_CHILD|WS_VISIBLE|SS_SUNKEN|SS_WHITEFRAME,
CRect(0, 0, 200, 300),
this,
IDC_STATIC1))
{
TRACE("Unable to create the static edit control !!");
return -1;
}
if (!m_font.CreatePointFont(90, "Courier New"))
{
TRACE("Creation of font failed !!\n");
return -1;
}
SetFont(&m_font);
SetWindowText("");
return 0;
}
Ajay Kalra wrote:
PSN wrote:
ya, even i guess the problem is different while creation of the control
itself is problematic .. it doesnt even work after the app has started
.. the same problems .. part of the window is drawn and the rest not !!
and yes, i dont call the parent paint function, CStatic::OnPaint()
directly ..
So for all you know, the control is not even created. Are you
subclassing it? How is it created? Dynamically? In resource editor?
You havent supplied relevant information to figure out the problem.
---
Ajay