PrnGetName() problem

PrnGetName() problem

Postby Roger Seiler » Fri Dec 01, 2006 4: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
User avatar
Roger Seiler
 
Posts: 223
Joined: Thu Dec 01, 2005 3:34 pm
Location: Nyack, New York, USA

Postby Antonio Linares » Sat Dec 02, 2006 7:09 pm

Roger,

This may be a fix for it. We appreciate your feedback,
Code: Select all  Expand view

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
User avatar
Antonio Linares
Site Admin
 
Posts: 42077
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], Otto and 74 guests