Using OCX in .NET

  • Thread starter Alhambra Eidos Kiquenet
  • Start date

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

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

(which is the difference AxInterop.XpdfViewer.dll and

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.

Ciaran O''Donnell

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question