Using OCX in .NET

  • Thread starter Thread starter Alhambra Eidos Kiquenet
  • Start date Start date
A

Alhambra Eidos Kiquenet

Hi misters,

I try use an OCX in my Winforms application with VS 2005.

The OCX is a PDF Viewer (XPdfViewer)

I have several issues about it:

1. I add reference to COM, and VS generate Interop.XpdfViewer.dll

When I call to method of COM, I get this error:

ErrorCode -2147467259

Exception Details: System.Runtime.InteropServices.COMException: Error
HRESULT E_FAIL has been returned from a call to a COM component

One question, how I get a detail description of a COMException ?? Any help
please.


2. I Choose Items in Toolbox and select COM (OCX). The VStudio generate
AxInterop.XpdfViewer.dll.

(which is the difference AxInterop.XpdfViewer.dll and
Interop.XpdfViewer.dll???)

For a Component Control, in design, the control XPdfViewer NOT appears in
toolbox, why ???

For Forms, in design, the control XPdfViewer appears in toolbox
For UserControl, in design, the control XPdfViewer appears in toolbox


Any suggestion about it ? Thanks in advance.
 
Its been a few years since I used COM based controls but I think the
difference is the Interop generated file is just a management wrapper around
the class for using it as a code library. the AxInterop is a wrapper around
it as an ActiveX control for using it on a form.
The reason it wont appear for a component is possibly because its an ActiveX
control as has a UI which so it can only be added to a Form/Usercontrol that
will use it for a UI control.
Someone with more recent experience of this than me might be able to confirm
this though. Its literally been 4 years or so since I used an ActiveX form
control in .NET
 
Back
Top