Array of custom controls
"Bill" <billa-l3pLR9/iSOgztatW0fm/[email protected]> Wed, 01 Jun 2011 22:11:08 -0000
| Newsgroups | gmane.comp.windows.wtl |
|---|---|
| Message-ID | <[email protected]> |
I need to make an dynamic array of custom controls subclassed from CStatic in a dialog. I have tried using CAtlArray but after the controls are created and the dialog begins running, there is an exception in CWindowImplBaseT::WindowProc. If I create the array using CStatic controls, it works.
I am sure this has something to do with the copy semantics of CAtlArray and the custom controls but I don't know what it is.
Is my approach sound?
The control is actually Bjarke Vikoe's CColoredEditCtrl
http://www.viksoe.dk/code/coloredcontrols.htm
In the header file:
CAtlArray<CColoredEditCtrl> m_timestamps;
In OnInitDialog()
for ( int i = 0; i < m_numTimestamps; i++ )
{
int ndx = m_timestamps.Add();
m_timestamps[ndx].Create( m_hWnd, ×tampRect, 0,
WS_CHILD | WS_VISIBLE | SS_CENTER );
m_timestamps[ndx].ShowWindow(SW_SHOW);
timestampRect.OffsetRect( 2 * controlWidth, 0 );
}
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/wtl/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/wtl/join
(Yahoo! ID required)
<*> To change settings via email:
[email protected]
[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/