Print Page | Close Window

ActiveX problem...

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=1261
Printed Date: 06 November 2025 at 11:22pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: ActiveX problem...
Posted By: thunder0
Subject: ActiveX problem...
Date Posted: 11 October 2004 at 4:15am

Is there anybody who attche CXTPToolbar to the activeX?

everything works fine except toolbar button clicked status doesn't change...

I use CXTPOffice2003Theme....

I guess it is dll problem....

If anyone who have exprience with that, let me know....^^




Replies:
Posted By: Oleg
Date Posted: 12 October 2004 at 2:11am

ActiveX frame has no WM_IDLEUPDATECMDUI messages. You must emulate it:

SetTimer(WM_IDLEUPDATECMDUI, 100, NULL);

 

void CActiveXDocControl::OnTimer(UINT nIDEvent)
{
    // Since we're in an OCX, we don't control the message loop,
    // so CWinThread::OnIdle is never called. That means we have
    // to periodically pump the ON_UPDATE_COMMAND_UI messages
    // by hand.
   
    SendMessageToDescendants(WM_IDLEUPDATECMDUI, TRUE);
    COleControl::OnTimer(nIDEvent);
}



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: fredwobus
Date Posted: 04 November 2004 at 8:46am
I am also using the CXTPToolBar inside an ActiveX ATL-Control.
So I am also struggling with the CmdUI stuff.

I added a messagel handler in my message map

BEGIN_MSG_MAP(CMyControl)
..
    MESSAGE_HANDLER(WM_IDLEUPDATECMDUI, OnIdleUpdateCmdUI)
    CHAIN_MSG_MAP(CComCompositeControl<CMyControl>)
END_MSG_MAP()

and I DO get these messages.


I have another problem :
The wParam of the OnIdleUpdateCmdUI handler means disableIfNoHandler. As I don't have any UpdateUI Handlers - all my buttons are disabled.

How do you write an UpdateUI handler for a toolbar UI in an ActiveX control ?


Posted By: Oleg
Date Posted: 05 November 2004 at 1:21am

same as standard MFC application. add

ON_UPDATE_COMMAND_UI(ID, OnUpdateID) in message map of Frame.



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net