When hosting a .Net control via QAxWidget, an exception is thrown in call to
Exception text: "COM object that has been separated from its underlying RCW cannot be used"
The reason of the exception is a previous call to
When .Net ActiveX wrapper (from .Net framework) performs that function, it completely destroys RCW for the client site:
The call to FinalReleaseComObject completely destroys RCW (Runtime Callable Wrapper) for COM object.
Due to the fact that both IOleClientSite and IAdviseSink interfaces are represented by the same QAxClientSite object, the next call to Unadvise fails with an exception.
If there is no obvious reason why the order of the calls is as is, I propose to change the order:
Thus the RCW won't be deleted.