Re: Array of custom controls

Igor Tandetnik <[email protected]> Wed, 01 Jun 2011 18:17:34 -0400
Newsgroups gmane.comp.windows.wtl
Message-ID <[email protected]>
On 6/1/2011 6:11 PM, Bill wrote:
> 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.

CAtlArray wants its elements to be copyable. CStatic is not derived from 
CWindowImpl, just from CWindow, and thus is copyable. Your class is 
derived from CWindowImpl, and thus is not copyable. So you can't put it 
into CAtlArray by value.

Allocate them on the heap, store pointers in CAtlArray.--
Igor Tandetnik



------------------------------------

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/