Page 1 of 1

Unable to cast COM object of type 'CADViewLib.DXFImageClass'

Posted: 12 Apr 2011, 15:23
by gnani
hello,

i am using CADViewx with c#.net.when i am trying find the extents using the AXCadvieX.DXFImage.Extents method i am getting the following error.


"Unable to cast COM object of type 'CADViewLib.DXFImageClass' to interface type 'CADViewLib.IDXFImage'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{E5FD69A2-2C2E-4E65-91D3-AF93ACAC3028}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))."


the code is :

CADViewLib.tagFRectLong vExt = AXCadViewX.DXFImage.Extents;

Re: Unable to cast COM object of type 'CADViewLib.DXFImageCl

Posted: 13 Apr 2011, 14:22
by support
Hello.
Setting the drawing extents to tagFRectLong instance not result in any errors in CADViewX 5 C# demo. How many treads access CADViewX component?

Alexander.

Re: Unable to cast COM object of type 'CADViewLib.DXFImageCl

Posted: 15 Apr 2011, 11:53
by gnani
hello sir, i am getting the same error.for u r reference i am sending shot also.please go through this.

Re: Unable to cast COM object of type 'CADViewLib.DXFImageCl

Posted: 15 Apr 2011, 15:17
by support
Hello.
We haven't encountered such error in C# demo application. Please note DXFImage supports Apartment treading model that restricts only one client thread can call the object at a time. The ApartmentState of the thread that calls the COM object must match the apartment state used by the COM object.

Alexander.