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

Discuss and ask questions about CADViewX (Lite and Pro versions).

Moderators: SDS, support, admin

Post Reply
gnani
Posts: 2
Joined: 12 Apr 2011, 15:15

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

Post by gnani » 12 Apr 2011, 15:23

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;

support
Posts: 3271
Joined: 30 Mar 2005, 11:36
Contact:

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

Post by support » 13 Apr 2011, 14:22

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.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

gnani
Posts: 2
Joined: 12 Apr 2011, 15:15

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

Post by gnani » 15 Apr 2011, 11:53

hello sir, i am getting the same error.for u r reference i am sending shot also.please go through this.
Attachments
cadviewxerror.jpg
cadviewxerror.jpg (123.92 KiB) Viewed 34185 times

support
Posts: 3271
Joined: 30 Mar 2005, 11:36
Contact:

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

Post by support » 15 Apr 2011, 15:17

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.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply