FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour PrnGetName() problem
Posts: 223
Joined: Thu Dec 01, 2005 03:34 PM
PrnGetName() problem
Posted: Fri Dec 01, 2006 04:01 PM

Antonio,

In rare cases where a workstation has a default printer selected that is a printer attached to another workstation that happens to be turned off, calling PrnGetName() can cause a GPF.

Perhaps, when you have a chance, you could modify the C code in PrintDC.c for this function so that it will trap this situation and prevent the GPF. Perhaps a way to do this, in such a case, is to display the standard printer selection dialog so that the user can select another active printer to be the default.

  • Roger
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
PrnGetName() problem
Posted: Sat Dec 02, 2006 07:09 PM
Roger,

This may be a fix for it. We appreciate your feedback,
CLIPPER PRNGETNAME( PARAMS ) // () --> cPrinter
{
   LPDEVNAMES lpDevNames;

   PrinterInit();

   if( pd.hDevNames )
   {
      lpDevNames = (LPDEVNAMES) GlobalLock( pd.hDevNames );

      if( lpDevNames )
      {
         _retc( ( LPSTR ) lpDevNames + lpDevNames->wDeviceOffset );
        GlobalUnlock( pd.hDevNames );
      }
      else
         _retc( "" );
   }
   else
      _retc( "" );
}
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion