471,603 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,603 software developers and data experts.

adding acrobat control programatically

greetings,

i am trying to develop an application which is supposed to show pdf. i
have added the activeX control from the acrobat in my application.
everything was working fine, until i got to test it on another system
which had acrobat 6.0 installed.... there my application gave error
while loading. I have acrobat 7.0.
the solution i this is to get acrobat contorl programatically and not
through adding components at design time.
i belive solution is somewhere in these lines of code, but am unable to
use it properly....

AcrobatType = Type.GetTypeFromCLSID("AcroPDF");
object o =Activator.CreateInstance (AcrobatType);

looking for guidance,

Feb 3 '06 #1
1 3295
Khadim,

What you need to do is create a class that derives from AxHost. Then,
from your constructor, you have to call the constructor of the base class,
passing the CLSID of the control you want to host.

You can then add this control to your application. However, any of the
properties/methods exposed by the adobe active x control specifically will
not be exposed. You can access the underlying COM object through the GetOcx
method, but you will have to cast it to the appropriate COM interface on the
object. If between versions, the interfaces are not the same, you will have
to switch on the version number for each call to the interface.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Khadim" <as***********@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
greetings,

i am trying to develop an application which is supposed to show pdf. i
have added the activeX control from the acrobat in my application.
everything was working fine, until i got to test it on another system
which had acrobat 6.0 installed.... there my application gave error
while loading. I have acrobat 7.0.
the solution i this is to get acrobat contorl programatically and not
through adding components at design time.
i belive solution is somewhere in these lines of code, but am unable to
use it properly....

AcrobatType = Type.GetTypeFromCLSID("AcroPDF");
object o =Activator.CreateInstance (AcrobatType);

looking for guidance,

Feb 3 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Tonya | last post: by
1 post views Thread by francois | last post: by
3 posts views Thread by sam | last post: by
2 posts views Thread by Khan | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by CCCYYYY | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.