Raw Print in C - FWH Version

Raw Print in C - FWH Version

Postby paulrhanson » Thu Jan 29, 2009 2:56 pm

My code has been using this function written in C and linked into my clipper 5.2 FW 2.4 application.

I am converting the application to FWH. I'm not a C programmer so this inherited code is not easy for me.

Is there a way to replace this code using straight Harbour/FWH?

Thanks for your help!

-Paul

Code: Select all  Expand view
CLIPPER RAWPRINT() // ( hDC, cText ) --> nBytesSent
{
   LPBYTE lpbData;
   LPWORD lpwLength;
   if (PCOUNT()==2 && ISNUM(1) && ISCHAR(2))
   {   
      // Create a buffer 2 bytes larger that length of cText
      lpbData = _xgrab(_parclen(2)+2);
      if (lpbData)
      {
         lpwLength = (LPWORD)lpbData;
         // First WORD (16 bits, 2 bytes) contains the number of bytes of input data
         *lpwLength = _parclen(2);
         // Data starts at 3rd byte, copy cText to data
         _bcopy(lpbData+2,_parc(2),_parclen(2));
         // Return nBytesSent, failure if nBytesSent<=0
         _retni(Escape(_parni( 1 ),PASSTHROUGH,NULL,(LPSTR)lpbData,NULL));
         // Free memory!
         _xfree(lpbData);
      }
      else
         _retni(0); // No memory!
   }
   else
      _retni(0); // Invalid args!
}
-Paul
paulrhanson
 
Posts: 13
Joined: Fri Sep 12, 2008 2:40 am

Re: Raw Print in C - FWH Version

Postby James Bott » Thu Jan 29, 2009 5:58 pm

Paul,

Maybe this discussion will solve your problem:
viewtopic.php?f=3&t=5282&p=23401&hilit=raw+print#p23401

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 79 guests

cron