Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Win7 - Problem with OCX of ADOBE, FoxitReader and any other in c#,

63 views
Skip to first unread message

Bogdanski@discussions.microsoft.com Wojciech Bogdanski

unread,
Nov 17, 2009, 11:29:01 AM11/17/09
to

Hello, I have problems using OCX library in C# - I am trying to display PDF
document using Adobe or Foxit Reader.

The problem does not occur in Windows XP. In program Microsoft 2008 C#
Express edition the libraries are regsitered and I can put them on the form.
I can compile the program without errors but when I try to run it - I get
error message "Klasa niezarejestrowana. (Wyjątek od HRESULT: 0x80040154
(REGDB_E_CLASSNOTREG))" -> "Class not registered. Exception HRESULT:
0x80040154 (REGDB_E_CLASSNOTREG))".

This occurs on
((System.ComponentModel.ISupportInitialize)(this.axAcroPDF1)).EndInit();

but before are folliwing lines and those lines does not generate any errors:
this.axAcroPDF1 = new AxAcroPDFLib.AxAcroPDF();
((System.ComponentModel.ISupportInitialize)(this.axAcroPDF1)).BeginInit();

When I copy compiled program to Windows XP - without any modification - it
runs without problems.

I see that many people have such problems with OCX in Windows 7.

Marcin

unread,
Dec 3, 2009, 1:33:47 AM12/3/09
to
On 17 Lis, 17:29, Wojciech Bogdanski <Wojciech

Hmmm, wydaje mi się, że twój kod jest nieco skomplikowany.

Dodajesz referencje do AxaAcro, a następnie, wrzucasz kontrolkę na
formularz i:

string filename=@"c:\test.pdf";
axAcroPDF1.src = filename;

i musi działać na każdym systemie.


Dodatkowo jeśli chcesz drukować to co przeglądniesz to,


axAcroPDF1.printAllFit(true);


i tyle :)

0 new messages