PrnGetName() problem

Post Reply
User avatar
Roger Seiler
Posts: 223
Joined: Thu Dec 01, 2005 3:34 pm
Location: Nyack, New York, USA
Contact:

PrnGetName() problem

Post by Roger Seiler »

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

Post by Antonio Linares »

Roger,

This may be a fix for it. We appreciate your feedback,

Code: Select all


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
Post Reply