Orphaned Raster-XChange Instances

Raster-XChange SDK (all versions)
This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's Raster-XChange Printer Drivers SDK (only).

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

Post Reply
edatmitchell
User
Posts: 8
Joined: Thu Jan 14, 2010 7:55 pm

Orphaned Raster-XChange Instances

Post by edatmitchell » Thu Apr 01, 2010 6:45 pm

We use Raster-XChange to generate tiff-based custom reports for our customers. We have noticed that if our application crashes, it orphans a printer instance which is visible from the Windows Printers And Faxes dialog. During testing of our application on Windows7 we were unable to generate a tiff file with Raster XChange if one of these orphaned printers existed. We also notice that PDF-XChange has an interface that exposes a RemoveOrphanPrinters method that cleans up these orphaned instances. We see no such method for Raster X-Change. While we wish our app would never crash, the reality is that it will at some point for some users and we need a programmatic way of removing orphaned instances of Raster XChange. What do you suggest?

Here’s our sample code for instantiating a Raster XChange printer:

Code: Select all

   RXC::IPrinterFactoryPtr pRasterFactory = NULL;
      UMCPPLogger logger;
   if (!m_pRasterPrinter && !m_pRasterDevMode)
   {
      try
      {
                  _LOGINFO_1(logger.LogManager(),"tifdebug","Try to instantiate factory.");
         pRasterFactory = RXC::IPrinterFactoryPtr(__uuidof(RXC::PrinterFactory));
      }
      catch(_com_error& e)
      {
         CString strError;
         strError.Format("Exception thrown while retrieving raster printer class factory. %s",e.ErrorMessage());
         _LOGERROR_1(logger.LogManager(),"tifdebug",strError);
         return false;
      }
            _LOGINFO_1(logger.LogManager(),"tifdebug","Factory instantiated successfully.");
      try
      {
                  _bstr_t bstrDriverName = GetDriverName();
         m_pRasterPrinter = pRasterFactory->Printer[L"", bstrDriverName];
      }
      catch(_com_error& e)
      {
         CString strError;
         strError.Format("Exception thrown during raster printer creation. %s",e.ErrorMessage());
         _LOGERROR_1(logger.LogManager(),"tifdebug",strError);
         return false;
      }

User avatar
Paul - Tracker Supp
Site Admin
Posts: 4885
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: Orphaned Raster-XChange Instances

Post by Paul - Tracker Supp » Thu Apr 01, 2010 10:18 pm

Hi edatmitchell,

this is definitely a question that the dev team are going to have to answer. Unfortunately Easter is upon us and it may be next week before you get an answer. If you are OK with that I'll let this post sit until then otherwise please let me know and I'll see if I can't find someone to take a look,

regards
_________________
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com

User avatar
Roman - Tracker Supp
Site Admin
Posts: 265
Joined: Sun Nov 21, 2004 3:19 pm

Re: Orphaned Raster-XChange Instances

Post by Roman - Tracker Supp » Fri Apr 02, 2010 8:54 am

Hi,
Orphaned Raster-XChange printers are deleted automatically in about 10 minutes after the COM client crashes. They are also deleted on spooler restart.
I'll add your request for a programmatic method to the next release schedule of Raster-XChange.
Tracker Software Products

Please ZIP any files uploaded to this forum or they will not be posted !
You may also use a RAR or 7Z archive format

Post Reply