Late Binding in C# - Add control to winform

U

Uwe Braunholz

Hello,

I user c# 2.0 and want to add acrobat-reader to my application, so I
have to create a Control from AcroPDF.dll to my app. I could do this by
early binding, but I want to program to run without acrobat reader
being installed.

Now I want to create an instance of this controls and add it to my form
at runtime.

I think I have to do something like that:
Type acroT;
acroT =
Type.GetTypeFromProgID("AxAcroPDFLib.AxAcroPDF"); //or AcroPDF.PDF
object acroObj = Activator.CreateInstance(printerType);
this.Contols.Add(acroObj);
As acroObj is a com-object, I can't add it to the form that easy.
How could I do this (without early-binding or adding some references
which need to be deployed)?

Thank you!
Regards,
Uwe
 

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

Top