none
c++ refresh Get_Label via Button Clicked method RRS feed

  • Question

  • Hi.

    i had few buttons in ribbon xml which call Get_label and i need to refresh it via another button.

    i had found that i may make it with Invalidate method in  COM_INTERFACE_ENTRY(IRibbonUI)- i had create this interface and make  Invalidate method  .But i still cant understand how make this HRESULT OnLoad([in] IRibbonUI* pRibbon);

    i had found some example in C#

    IRibbonUI myRibbon;

    public void ribbonLoaded(IRibbonUI ribbon)
    {
    myRibbon = ribbon;
    }

    Its ok - but what is myRibbon ?Or may somebody give me link where i can read about RibbonUI via c++

    and also in Buttonclicked methos i had  IDISPATCH pointer and in  OnLoad([in] IRibbonUI* pRibbon .May some body explaine me why Onload use IribbonUI

    Tnx 


    Friday, March 29, 2013 8:40 AM

Answers

  • ok - solved.need to had more attention

    MSDN

    Callbacks that return properties of a control (such as the gallery control's getItemCount callback) normally get called only as the Fluent UI initializes, unless you explicitly force the control to re-initialize. You can force this to happen by storing a reference to the Ribbon in your code, and then calling methods of the Ribbon that invalidate an individual control or the entire Ribbon. To do this, you must add the onLoad attribute, specifying a callback procedure, in the <customUI> element. The onLoad callback is called once, when the Ribbon extensibility markup file is successfully loaded. The callback procedure receives an IRibbonUI object as a parameter—your code can cache this reference for later use. The IRibbonUI class provides methods that enable you to invalidate a single control or the entire Ribbon.


    Friday, March 29, 2013 2:02 PM

All replies

  • ok - solved.need to had more attention

    MSDN

    Callbacks that return properties of a control (such as the gallery control's getItemCount callback) normally get called only as the Fluent UI initializes, unless you explicitly force the control to re-initialize. You can force this to happen by storing a reference to the Ribbon in your code, and then calling methods of the Ribbon that invalidate an individual control or the entire Ribbon. To do this, you must add the onLoad attribute, specifying a callback procedure, in the <customUI> element. The onLoad callback is called once, when the Ribbon extensibility markup file is successfully loaded. The callback procedure receives an IRibbonUI object as a parameter—your code can cache this reference for later use. The IRibbonUI class provides methods that enable you to invalidate a single control or the entire Ribbon.


    Friday, March 29, 2013 2:02 PM
  • Hi Loik,

    I'm glad to hear that your issue has been resolved.

    Thank you for sharing your solution which might be very helpful to other community members.

    Have a nice day.

    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, April 1, 2013 1:50 PM
    Moderator