I have solved this issue in my custom dockable window (C#). The reason was an exception in the constructor of the Windows Form implementing IDockableWindow. When you experience the error message "HRESULT: 0x8000FFFF, E_UNEXPECTED", this is likely because of an exception in your constructor. I resolved it by executing all constructor code within a try-catch-block, logging the error and swallowing the exception.
public partial class MyDockWindow : UserControl, IDockableWindowDef, IDockableWindowImageDef, IDockableWindowInitialPlacement
{
public MyDockWindow()
{
try
{
// do smth.
// may be an exception is raised...
}
catch (Exception ex)
{
// logging of error
// do not throw exception!
}
}