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!
}