Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - WM_DESTROY of subclassed ActiveX control
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

WM_DESTROY of subclassed ActiveX control

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: WM_DESTROY of subclassed ActiveX control
    Posted: 21 July 2006 at 11:15am
Hi;
 
After ugrading from toolkit 4.1 to toolkit 10.1 or 10.2 the WM_DESTROY message handler of subclassed ActiveX controls is no longer called.
To reproduce create a MDI application with toolkit wizard (VC++ .NET 2003) and insert a ActiveX control as a member of the CView derived class of the MDI child window.
 
In OnCreate() handler of the view create and subclass the ActiveX control. Subclassing is necessary to receive and handle WM_xxx messages within the CWnd derived wrapper class of the control.

 

// COCXTestView message handlers

int COCXTestView::OnCreate(LPCREATESTRUCT lpcs)

{

if (CView::OnCreate(lpcs)!=0)

return -1;

VERIFY(_OCXControl.Create(0,0, WS_VISIBLE|WS_CHILD, CRect(0,0,0,0), this, 1));

HWND hWnd=_OCXControl.Detach();

VERIFY_OCXControl.SubclassWindow(hWnd));

return 0;

}

 
Insert a WM_DESTROY message handler into the wrapper class of the ActiveX control and for testing purposes also a WM_SIZE handler (to asure that WM_xxx messages are routet through the message map of the CWnd wrapper class.
 
When compiling and linking with Toolkit 4.1 the WM_DESTROY message of the wrapper class gets called but when linking to Toolkit 10.x it never gets called.
 
Since we have to cleanup in this handler, we need the OnDestroy() mechanism.
 
Any Ideas whats wrong and how to fix this.
 
Martin
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 21 July 2006 at 2:44pm
Hello,
I don't think toolkit can do it. Check your code.
 
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 21 July 2006 at 4:12pm

Hello;

My first thought also was that it has nothing to do with the toolkit. This resulted in a several weeks lasting conversation with Microsoft. At least I built two test applications - one with, one w/o toolkit integration. The toolkit version shows this behaviour. The plain MFC version is calling the handler.

So at the moment I believe it has something to do with your installed message hooks.

To reproduce it, you only have to create a simple MDI application and extend it with one ActiveX control member within the CView derived MDI client window view. To simplify the subclassing and message handling I derived from the CWnd control wrapper class and only inserted two message handler into this class - one for WM_SIZE and one for WM_DESTROY. OnSize is called while OnDestroy not

Thats all ...

Martin

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.