FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Raw Print in C - FWH Version
Posts: 13
Joined: Fri Sep 12, 2008 02:40 AM
Raw Print in C - FWH Version
Posted: Thu Jan 29, 2009 02: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

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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Raw Print in C - FWH Version
Posted: Thu Jan 29, 2009 05:58 PM

Paul,

Maybe this discussion will solve your problem:

viewtopic.php?f=3t=5282p=23401hilit=raw+print#p23401

Regards,
James

&&&

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10

Continue the discussion