rubberduck-vba / Rubberduck

Every programmer needs a rubberduck. COM add-in for the VBA & VB6 IDE (VBE).
https://rubberduckvba.com
GNU General Public License v3.0
1.91k stars 299 forks source link

Hotkeys only register in 1 application if multiple RD instances are running. #2493

Closed comintern closed 5 years ago

comintern commented 7 years ago

Just had RD open in Excel and opened another VBE from Access and found this in my log file:

2017-01-07 09:49:44.6256;INFO-2.0.10.17483;Rubberduck.App;Rubberduck version 2.0.10.17483 loading:
    Operating System: Microsoft Windows NT 6.1.7601 Service Pack 1 x64
    Host Product: Microsoft Office 2013 x86
    Host Version: 15.0.4857.1000
    Host Executable: MSACCESS.EXE;
2017-01-07 09:49:48.6505;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (Oemtilde) not registered.;
2017-01-07 09:49:48.7168;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (P) not registered.;
2017-01-07 09:49:48.7168;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (M) not registered.;
2017-01-07 09:49:48.7168;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (R) not registered.;
2017-01-07 09:49:48.7357;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (T) not registered.;
2017-01-07 09:49:48.7357;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (I) not registered.;
2017-01-07 09:49:48.7494;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (T) not registered.;
2017-01-07 09:49:48.7494;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (C) not registered.;
2017-01-07 09:49:48.7494;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (R) not registered.;
2017-01-07 09:49:48.7684;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (M) not registered.;
2017-01-07 09:49:48.7684;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (D6) not registered.;
2017-01-07 09:49:48.7684;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (E) not registered.;
2017-01-07 09:49:53.7184;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (Oemtilde) not registered.;
2017-01-07 09:49:53.7242;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (P) not registered.;
2017-01-07 09:49:53.7242;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (M) not registered.;
2017-01-07 09:49:53.7242;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (R) not registered.;
2017-01-07 09:49:53.7439;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (T) not registered.;
2017-01-07 09:49:53.7439;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (I) not registered.;
2017-01-07 09:49:53.7439;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (T) not registered.;
2017-01-07 09:49:53.7659;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (C) not registered.;
2017-01-07 09:49:53.7659;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (R) not registered.;
2017-01-07 09:49:53.7798;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (M) not registered.;
2017-01-07 09:49:53.7798;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (D6) not registered.;
2017-01-07 09:49:53.7798;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (E) not registered.;
2017-01-07 09:49:59.0920;DEBUG-2.0.10.17483;Rubberduck.UI.Command.MenuItems.ParentMenus.ParentMenuItemBase;(58338722) Executing click handler for menu item 'Code &Inspections', hash code 25666111;
2017-01-07 09:49:59.1024;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (Oemtilde) not registered.;
2017-01-07 09:49:59.1024;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (P) not registered.;
2017-01-07 09:49:59.1163;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (M) not registered.;
2017-01-07 09:49:59.1163;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (R) not registered.;
2017-01-07 09:49:59.1163;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (T) not registered.;
2017-01-07 09:49:59.1383;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (I) not registered.;
2017-01-07 09:49:59.1383;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (T) not registered.;
2017-01-07 09:49:59.1383;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (C) not registered.;
2017-01-07 09:49:59.1591;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (R) not registered.;
2017-01-07 09:49:59.1719;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (M) not registered.;
2017-01-07 09:49:59.1719;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (D6) not registered.;
2017-01-07 09:49:59.1719;DEBUG-2.0.10.17483;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (E) not registered.;

The only way that I can envision that this is happening is that somehow this call...

var hookId = (IntPtr)Kernel32.GlobalAddAtom(Guid.NewGuid().ToString());

...is returning the same Guid in both running instances (WTF, right?). .NewGuid() is apparently just a wrapper for CoCreateGuid, and its documentation states that "To a very high degree of certainty, this function returns a unique value – no other invocation, on the same or any other system (networked or not), should return the same value.", so I'm not sure exactly what is going on with this.

bclothier commented 5 years ago

Cannot reproduce so closing.