COM Exception during CPXCControlExClass.get_Printer(...)

PDF-XChange Drivers API (only) V4/V5
This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-XChange Printer Drivers SDK (only) - VERSION 4 & 5 - Please use the PDF-Tools SDK Forum for Library DLL assistance.

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan

Post Reply
jtuemmer
User
Posts: 2
Joined: Tue Sep 14, 2010 7:05 am

COM Exception during CPXCControlExClass.get_Printer(...)

Post by jtuemmer »

I am evaluating PDFXChange for integration into my own application.

I have written the following code (C#, VS 2008)

Code: Select all

...
public class TestPDFXChange {

        private CPXCPrinter printer;

        public TestPDFXChange() {
            
            CPXCControlEx printerFactory;


            printer = null;

            try {
                printerFactory = new PXCComLib.CPXCControlEx();

                if (printerFactory != null) {

                    printer = (CPXCPrinter)printerFactory.get_Printer("", "pdfXChange", "", "");

                    if (printer != null) {
                        logger.Debug("Printer created");
                        printer.OnFileSaved += new _IPXCPrinterEvents_OnFileSavedEventHandler(pdfXChangeOnFileSavedEventHandler);

                    } else {
                        logger.Error("Printer creation failed");
                    }

                } else {
                    logger.Error("Printer factory creation failed");
                }
            
            } catch (Exception exception) {
                logger.Error("Printer creation failed");
                logger.Error(exception.ToString());
            
            } finally {
            }

    ....

}
...
When the TestPDFXChange class is instantiated, I receive the following COM Exception:

Code: Select all

ERROR TestPDFXChangePrinter [0] - System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
   at PXCComLib.CPXCControlExClass.get_Printer(String pServerName, String pPrinterName, String pRegKey, String pDevCode)
   at TestPDFXChangePrinter..ctor()
My OS is Windows 7 64bit. I have installed the demo version of the SDK from the most current release (4.0185) on the website (https://www.pdf-xchange.com/product ... rivers-api).

Did I oversee anything? Any Idea?
jtuemmer
User
Posts: 2
Joined: Tue Sep 14, 2010 7:05 am

Re: COM Exception during CPXCControlExClass.get_Printer(...)

Post by jtuemmer »

Issue resolved. Another version of PDF-XChange Pro (3.x) was installed. After removing it and installing the redistributable package of the printer driver, everything is working as expected.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17948
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: COM Exception during CPXCControlExClass.get_Printer(...)

Post by Tracker Supp-Stefan »

Glad to hear that everything is solved jtuemmer,

And thanks for using our products.

Best Regards,
Stefan
Post Reply