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

ActiveX problem...

 Post Reply Post Reply
Author
Message
thunder0 View Drop Down
Newbie
Newbie


Joined: 11 October 2004
Location: Korea, South
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote thunder0 Quote  Post ReplyReply Direct Link To This Post Topic: ActiveX problem...
    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....^^

Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 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
Back to Top
fredwobus View Drop Down
Newbie
Newbie
Avatar

Joined: 02 September 2004
Location: Austria
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote fredwobus Quote  Post ReplyReply Direct Link To This Post 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 ?


Edited by fredwobus
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.

This page was generated in 0.219 seconds.