This seems to be a bug in WTL::CCommandBarCtrlImpl class template

Mojtaba Fathi <modjtabaf-/[email protected]>
Newsgroups gmane.comp.windows.wtl
Message-ID <[email protected]>
Hi

The WTL::CCommandBarCtrlImpl class template has a member variable named m_wndParent, which it uses to capture messages from it's parent window. This member must be released in response to WM_DESTROY message, to prevent incorrectly capturing the messages from parent, but it is released in the destructor. I think the following piece of code which exists in destructor, must be duplicated somewhere within the body of WTL::CCommandBarCtrlImpl::OnDestroy:

// CODE STARTS HERE
        if(m_wndParent.IsWindow())
            m_wndParent.UnsubclassWindow();
// CODE ENDS HERE

If I'm true, WTL::CCommandBarCtrlImpl::OnDestroy function could be like this:

// CODE STARTS HERE
    LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)
    {
        LRESULT lRet = DefWindowProc(uMsg, wParam, lParam);

        // START OF NEWLY ADDED CODE
        if(m_wndParent.IsWindow())
            m_wndParent.UnsubclassWindow();
        // END OF NEWLY ADDED CODE
            
            ...
            
// CODE ENDS HERE

Regards, Moji            




      

[Non-text portions of this message have been removed]



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

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:
    mailto:[email protected] 
    mailto:[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/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.