Quantcast
Channel: AvalonDock
Viewing all articles
Browse latest Browse all 2690

Commented Unassigned: Crashes when used in an Office addin (VSTO) [17457]

$
0
0
When a DockManager is used from an office addin (I tested it on Excel and Word), all seems well until the user tries to close the application, then it crashes rather ungracefuly.

Steps to reproduce - inside an office addin put the following code in the startup event hander:

private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
Window w = new Window() { Content = new Xceed.Wpf.AvalonDock.DockingManager() };
w.Show();
}

Run it, and then close the Excel (or word) application without closing the created window with the dockmanager.

The windows log shows the following data for the error:

Faulting application name: excel.exe, version: 15.0.4675.1000, time stamp: 0x5462a5bc
Faulting module name: KERNELBASE.dll, version: 6.3.9600.16656, time stamp: 0x5318237f
Exception code: 0xc000041d
Fault offset: 0x00000000000043c8
Faulting process id: 0x4008
Faulting application start time: 0x01d0a534f7616f64
Faulting application path: C:\Program Files\Microsoft Office\Office15\excel.exe
Faulting module path: C:\Windows\system32\KERNELBASE.dll
Report Id: 3bbaaebe-1128-11e5-826d-bc5ff42be63a
Faulting package full name:
Faulting package-relative application ID:

I use AvalonDock inside a CustomTaskPane, and the same crash occurs.
Comments: ** Comment from web user: anakic **

Ok, I think found the problem:

The DockManager uses the FocusElementManager class which uses the WinAPI to attach a focus hook, but it doesn't properly detach it because it uses the Application.Current.Exit to detach, but this event doesn't fire for VSTO addins.

I've just commented out the line:
FocusElementManager.SetupFocusManagement(
inside the DockingManager_Loaded event handler in DockingManager.cs as I don't mind the ctrl+tab focus issue.


Viewing all articles
Browse latest Browse all 2690

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>