OneMore
OneMore copied to clipboard
OneMore error - The callback function "GetRibbonLabel' was not found
Problem to Solve
I noticed a while ago that I would get an error: "Custom UI Runtime Error in OneMoreAddln" The callback function "GetRibbonLabel' was not found - Error title:
I am not sure how long it has been happening and whether it was since 5.8.5 or sometime after that (I think maybe a couple of weeks).
Extract of log below.
To Reproduce
Rebooted my PC.
Opened OneNote
Opened a 2nd instance of OneNote.
I haven't done much investigation, but thought I would raise it and I could do any testing you like.
Once I "OK to all" everything seems to work fine.
Environment (if applicable)
- Version 5.8.5 with OneNote 16.0.16529.20182
- OneMore Version [e.g. 3.4 - from the About dialog or from the log file]
Additional Context
01| Starting dllhost 25752, 2592 Mhz, 32 MB, en-US/en-US, v5.8.5, OneNote 15.0, Office 16.0, 2023-07-15 19:46 01| ..C:\Program Files (x86)\Microsoft Office\root\Office16\ONENOTE.EXE (16.0.16529.20182) 01| ..OnConnection(ConnectionMode:ext_cm_Startup,custom[1:Int32]) 01| ..OneAddInsUpdate(custom[]) 01| ..building ribbon 01| ..building ribbon colorizer commands 01| ..building ribbon language proofing commands 01| ..building context menu 01| ..OnStartupComplete(custom[]) 01| ..starting command service 01| ..starting reminder service 01| ..starting navigation service 01| ..ready 08| Running command UpdateCommand 03| ..defined 46 hotkeys for input locale 2057 08| error invoking action 08| System.Runtime.InteropServices.COMException Message: Exception from HRESULT: 0x80042023 Description: The action timed out ErrorCode: 0x80042023 (-2147213277) HResult: 0x80042023 (-2147213277) Source: Microsoft.Office.Interop.OneNote StackTrace: at Microsoft.Office.Interop.OneNote.ApplicationClassCOM.FindMeta(String bstrStartNodeID, String bstrSearchStringName, String& pbstrHierarchyXmlOut, Boolean fIncludeUnindexedPages, XMLSchema xsSchema) at Microsoft.Office.Interop.OneNote.ApplicationClass.FindMeta(String bstrStartNodeID, String bstrSearchStringName, String& pbstrHierarchyXmlOut, Boolean fIncludeUnindexedPages, XMLSchema xsSchema) at River.OneMoreAddIn.OneNote.<>c__DisplayClass72_0.<SearchMeta>b__0() at River.OneMoreAddIn.OneNote.<InvokeWithRetry>d__35.MoveNext() TargetSite: [Microsoft.Office.Interop.OneNote] Microsoft.Office.Interop.OneNote.ApplicationClassCOM::FindMeta()
Add any other context about the problem here. Attach page XML file or the app log file as appropriate. You can find the log file here: %localappdata%\temp\OneMore.log
THE FINE PRINT This is a hobby project that I started for myself. I'm happy to take requests and will promise to consider each one carefully but offer no guarantees that I will ultimately agree to their usefulness or have time to implement any of them. If OneNote offers a "close enough" work-around then I will probably reject the request - you've been warned!
That is a built-in OneNote Interop API. I'd be surprised if it just disappeared! I'm running the exact same build of OneNote as you are and don't see this. Could it be possible that your Office install needs repair?
I can try that. The strange thing is that everything seems ot be working fine. What symptom would you expect?
Every time OneNote wants to draw the OneMore ribbon and each of its items, it calls that API to get the text label. So I would expect a lot of them if it was missing and none of the OneMore ribbon items would have text.
vs
I have both of these on my screen now.
I closed the instance that had the duff - lack of captions and have 7 instances open and all seem fine. Maybe a resource race or a busy machine getting a time out?
I reported this https://github.com/stevencohn/OneMore/issues/1020#issue-1672107132. Using Ctrl+M to open a new window works fine, but launching OneNote more than twice doesn't.
@seaspeak you are right about the labels with the right click on taskbar and launch a new one - i.e. no labels. I can't test the error though as I know I clicked "yes to all" or somethign like that when I got the 2nd identical warning in this boot cycle. I'll try that next time I reboot.
@seaspeak you are right about the labels with the right click on taskbar and launch a new one - i.e. no labels. I can't test the error though as I know I clicked "yes to all" or somethign like that when I got the 2nd identical warning in this boot cycle. I'll try that next time I reboot.
I don't quick understand what you can't test. This issue was there for a long time. I guess you enabled the OneNote debug feature some time so that you noticed it: https://onemoreaddin.com/developers/Debugging%20OneMore_files/image001.png
I looked and just noticed the same thing. If I open additional onenote windows with CTRL-M, everything's fine. But if I open additional instances by shift-clicking onenote in the taskbar, I get the OneMore icons without text in the ribbon. I also get the buttons without text if I call onenote.exe from a command window.
I get no lines in the log with either method of launching one note.
Even when the text is missing, Everything still seems to work OK, (I don't get any error messages) and I do most of my OneMore stuff from the quick access toolbar so I hadn't really noticed this until just now.
It seems like the common element is when explorer calls onenote.exe when onenote.exe is already running. Maybe something with the timing of how it loads things, or what it passes during the load.
I did some testing with toolbars where the text is missing and found the following:
-
If I Right click and choose "use simplified ribbon" then right click again and pick "use classic ribbon" then the buttons are restored to normal with the text.
-
Collapsing and Un-collapsing the ribbon does not work. The buttons remain without text.
-
If I right click and customize the ribbon, what's interesting is that it shows <<No Label>> for the OneMore Items like this:
But with a normal toolbar it looks like this:
- If I go to the customize ribbon and uncheck Add-ins, when I click OK the bar is back to normal again with the text.
Hope this helps track it down a bit more.
@JRPX33 That's super helpful. Thanks!
Summary
- OneMore loads with initial instance of OneNote and ribbon is displayed and active
- OneMore ribbon loads when subsequent OneNote windows are opened using Ctrl+M
- A COM exception is thrown when a second instance of OneNote is ran from the Start menu or Shift-clicking the taskbar icon
- Secondary instances that failed to load the addin do not seem to affect the initial instance and its windows
Interestingly, the message implies that secondary instances are "given" the OneMore-extended ribbon model but failed to load the COM addin, I presume because the LoadBehavior is set to 3. I tried setting the LoadBehavior to 16 but OneMore failed to load even with the initial instances.
So... I suspect this is, in fact, a Microsoft OneNote issue and not an issue with OneMore or its add-in configuration and registration. I'll open an MS ticket, although we know those tickets usually sit unanswered for years.
I know nothing about Windows programming. This project NoteHighlight2016 loads icons successfully. Hope this information is helpful.
Thanks for that. But NoteHighlight2016 works because it doesn't use the GetRibbonLabel callback which is used to localize button names on the ribbon.
I just asked GPT the question out of boredom, and here is its response. I have no way of knowing whether it's talking nonsense or not. I understand that this is a serious discussion group, so please forgive me if you feel offensive. I'm really not good at Windows programming but want to help.
using System;
using System.Diagnostics;
using Microsoft.Office.Core;
public class RibbonManager
{
private IRibbonUI ribbon;
public void Initialize()
{
// Listen for window creation events of OneNote processes
Process[] processes = Process.GetProcessesByName("onenote");
foreach (Process process in processes)
{
process.EnableRaisingEvents = true;
process.Exited += OnOneNoteExited;
}
}
private void OnOneNoteExited(object sender, EventArgs e)
{
// Reinitialize Ribbon UI when a OneNote process exits
InitializeRibbon();
}
private void InitializeRibbon()
{
// Reinitialize Ribbon UI and set callback functions
ribbon.Invalidate();
}
public void RibbonLoaded(IRibbonUI ribbon)
{
// Save the IRibbonUI object when Ribbon is loaded
this.ribbon = ribbon;
InitializeRibbon(); // Initialize Ribbon UI
}
}
That's kinda awesome. Except it's totally wrong.
The EnableRaisingEvents property and its related event handlers like Exited do not work in managed .NET C#. It's actually documented by Microsoft.
Go home GPT, you're drunk.