Hello,
I'm using the Designe Review 2012 and C# to create a DWF viewer.
I want to disable the toolbar via the command property of the IAdECompositeViewer.
The problem is, when i want to create a IAdCollection out of the commands i get the following exception:
Unable to cast COM object of type 'System.__ComObject' to interface type 'AdCommon.IAdCollection'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{7F25C648-F6D4-400E-A3E3-7FEBC5D1B829}' failed due to the following error: Schnittstelle nicht unterstützt (Interface not supported) (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
The code where the error occurs is the following:
void axCExpressViewerControl1_OnEndLoadItem(
object sender,
IAdViewerEvents_OnEndLoadItemEvent e)
{
if (e.bstrItemName == "VIEWER")
{
this.compositeViewer = (ECompositeViewer.IAdECompositeViewer)this.axCExpressViewerControl1.ECompositeViewer;
this.compositeViewer.PaperVisible = false;
AdCommon.IAdCollection Commands = (AdCommon.IAdCollection)this.compositeViewer.Commands;
I try to disable the toolbar when the viewer was loaded but the error occurs in the last line where i cast the Commands to the type AdCommon.IAdCollection like it is shown in the documentation.
Does anyone know why this error occurs, I also tried to retrieve the commands when the document was loaded but the same exception is thrown.
Greetings Sancho
Solved! Go to Solution.
Solved
got a conflict of the AdCommon.dll of the Design Review and the DWG TrueView.
After deleting DWG TrueView it worked fine.
I dont have the Trueview and the problem still here, i have two part Adcommon library dll in my COM folder, it is very big problem for me, how can i solve it?