COMException when trying to assign document to the Synchronizer

  • 2.4K Views
  • Last Post 12 May 2016
dns posted this 09 May 2016

Hello,

I have the following code and am working in Visual Studio 2013:

            ComponentSynchronizer Synchronizer = new ComponentSynchronizer();
            Synchronizer.DocumentViewer =                   (FineReaderVisualComponents.DocumentViewer)axDocumentViewer2.GetOcx();
            IEngineLoader loader = new FREngine.OutprocLoader();
            IEngine engine = loader.GetEngineObject("xxx");
            engine.ParentWindow = this.Handle.ToInt32();
            engine.ApplicationTitle = this.Text;

            document = engine.CreateFRDocumentFromImage(@"mypdf.pdf", null);

            Synchronizer.Document = document;
            //axDocumentViewer2.FRDocument = document;
            document.Close();

But both Synchronizer.Document = document; and axDocumentViewer2.FRDocument = document; cause a COMException in the dll AxInterop.FineReaderVisualComponents.

The details state "Access violation - no RTTI data!".

Best Regards

Oksana Serdyuk posted this 12 May 2016

Please sorry for the delay with response.

It is impossible to use Visual Components together with the OutprocLoader object, as the components need to work with the Engine internal objects and in case of the OutprocLoader usage they will be in the separate processes. Please see the Developer's Help file > Guided Tour > Programming Aspects > Different Ways to Load the Engine Object for details.

Close