none
Invalidate and InvalidateControl callbacks failing for Office 2007 RRS feed

  • Question

  • Hi,

    I need to customize Office ribbon by adding a new tab. This tab has a button group which has a single control, which could either be a button or a dropdown list depending on some external event.  For this, i need to invalidate this control after every user action.

    I am using IDispatch::Invoke to call IRibbonUI::InvalidateControl method() but this call is failing for Office 2007 (the same code is working fine with Office 2010). When Invoke call is made to call Invalidate or InvalidateControl method, the call fails and following error string is returned :

    0x000036b7 The requested lookup key was not found in any active activation context.


    Parul Gupta



    • Edited by Ninja8 Monday, May 14, 2012 2:37 PM
    Monday, May 14, 2012 7:47 AM

Answers

  • Hello Parul,

    You say the group has either one or another type of control. Is the argument in the invoke to Invalidate or InvalidateControl consistent with the control type?

    Does your code check for whether the control is enabled before invalidating it?

    Button controls have a getEnabled attribute, to which you assign the name of a procedure (same idea as assigning a procedure to the onAction attribute). The method signature of this procedure passes a parameter representing the control so that you can test which control is calling back and it returns a boolean value that determines whether the control should be enabled (true) or disabled (false). Your procedure would then check the condition appropriate for the control and return True or False, as required.

    For more detailed information, please see the 3-part set of articles "Customize the 2007 Office Fluent Ribbon for Developers" on the Ribbon UI site at http://msdn.microsoft.com/en-us/office/aa905530.aspx

    The difference in behavior between Office 2010 and Office 2007 suggests the possibility of something that was fixed between versions. Would you describe the context of the systems on which you use your ribbon in the different Office versions. The OS, the version of IE, the service pack level of Office and Windows, etc. If you're running on Windows XP plese refer to
    949377 When you try to install Windows XP Service Pack, you receive the error message "Access is denied" or "Service Pack installation did not complete"
    http://support.microsoft.com/kb/949377/EN-US

    and to
    950717 Steps to take before you install Windows XP Service Pack 3
    http://support.microsoft.com/kb/950717/EN-US


    Please remember to mark the replies as answer if they help and unmark them if the provide no help. and click "Vote as Helpful" this and other helpful posts, so other users will see your thread as useful. Chris Jensen

    Thursday, May 17, 2012 4:59 PM
    Moderator

All replies

  • Hi Parul,

    Welcome to the MSDN forum!

    That's sound strange. According to the message, it sounds like something is missing in the registry. Since I am not familiar with c++, I am trying to involve someone familiar with this. It will take some time. You patience will be greatly appreciated.

    Thanks.


    Yoyo Jiang[MSFT]
    MSDN Community Support | Feedback to us

    Wednesday, May 16, 2012 3:56 AM
    Moderator
  • Hello Parul,

    You say the group has either one or another type of control. Is the argument in the invoke to Invalidate or InvalidateControl consistent with the control type?

    Does your code check for whether the control is enabled before invalidating it?

    Button controls have a getEnabled attribute, to which you assign the name of a procedure (same idea as assigning a procedure to the onAction attribute). The method signature of this procedure passes a parameter representing the control so that you can test which control is calling back and it returns a boolean value that determines whether the control should be enabled (true) or disabled (false). Your procedure would then check the condition appropriate for the control and return True or False, as required.

    For more detailed information, please see the 3-part set of articles "Customize the 2007 Office Fluent Ribbon for Developers" on the Ribbon UI site at http://msdn.microsoft.com/en-us/office/aa905530.aspx

    The difference in behavior between Office 2010 and Office 2007 suggests the possibility of something that was fixed between versions. Would you describe the context of the systems on which you use your ribbon in the different Office versions. The OS, the version of IE, the service pack level of Office and Windows, etc. If you're running on Windows XP plese refer to
    949377 When you try to install Windows XP Service Pack, you receive the error message "Access is denied" or "Service Pack installation did not complete"
    http://support.microsoft.com/kb/949377/EN-US

    and to
    950717 Steps to take before you install Windows XP Service Pack 3
    http://support.microsoft.com/kb/950717/EN-US


    Please remember to mark the replies as answer if they help and unmark them if the provide no help. and click "Vote as Helpful" this and other helpful posts, so other users will see your thread as useful. Chris Jensen

    Thursday, May 17, 2012 4:59 PM
    Moderator