Errorhandling

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

abc123abc123
User
Posts: 35
Joined: Mon Oct 17, 2011 2:36 pm

Errorhandling

Post by abc123abc123 »

When I open a file which is no pdfdocument i get an error message from the activex controll and when i close this message i get an second message from my exception. Is it possible to deactivate the messages from the sdk? If not can I edit/catch them.
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19885
Joined: Mon Jan 12, 2009 8:07 am

Re: Errorhandling

Post by Stefan - PDF-XChange »

Hello abc123,

Please do have a look at the Manual/Help for the Viewer AX - and particularly the "3.1 How to Open a Document?" section -
There are code snippets in several programming languages. If yours supports it you should definitely be including the open document command in a try...catch statement, and this will correctly rise error codes when the operation is unsuccessful.

Best,
Stefan
Tracker
abc123abc123
User
Posts: 35
Joined: Mon Oct 17, 2011 2:36 pm

Re: Errorhandling

Post by abc123abc123 »

I tried this. And the result was that i get the error message like before and after this message i jump into the exception.
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19885
Joined: Mon Jan 12, 2009 8:07 am

Re: Errorhandling

Post by Stefan - PDF-XChange »

Are you trying to open this "non-pdf" file via code or via the UI of the AX?

Best,
Stefan
abc123abc123
User
Posts: 35
Joined: Mon Oct 17, 2011 2:36 pm

Re: Errorhandling

Post by abc123abc123 »

Via code. I have my own opendialog which gives me the filepath. Then I want to open this selected document. But if this is no-pdf-file i get this errormessage:Error opening document "C:\...\*.nopdf": Unknown error: 0x00CE556
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2445
Joined: Thu Jun 30, 2005 4:11 pm

Re: Errorhandling

Post by Vasyl - PDF-XChange »

Use special flag PXCVA_NoUI.
Example:

Code: Select all

pdfViewer.OpenDocument(fileName, ..., PXCVA_NoUI);
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.