InvalidCastException was unhandled by user code

F

FG

Has anyone seen the following exception:

Unable to cast COM object of type
'Microsoft.Office.Interop.VisOcx.DrawingControlClass' to interface type
'Microsoft.Office.Interop.VisOcx.IDrawingControl'. This operation failed
because the QueryInterface call on the COM component for the interface with
IID '{9BF6FD73-F05B-406E-B938-09E2B413528E}' failed due to the following
error: Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL)).

My main form has one delegate broadcasting to five other forms which have a
visio control on them.

when I use begininvoke calling this.axDrawingControl1.Window.Visible throws
the above error. On the other hand, when I use just the delegate everything
works.

Here is my begininvoke:
RetrieveIDataObject test = new RetrieveIDataObject(ReturnIDataObject);
test.BeginInvoke(new AsyncCallback(CallbackMethod), test);

Any advice?

Regards,
FG
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top