Page 1 of 2

problem in printing function

Posted: Tue Apr 09, 2013 2:04 pm
by viren092002
I HAVE DEVLOP A CODE FOR PRINTING FILE ON PRINTER, IT IS ORIGNALY DEVLOPED WITH CLIPPER 5.3B, NOW I TRY IT TO RUN UNDER HMG 3.1.1, I HAVE FOUND FOLLOWING PROBLEMS

(1) I HAVE CHANGE MY CODE, I HAVE CREATE A FILE ON DISK AND THEN USE WIN_PRINTFILERAW() FUNCTION TO PRINT IT ON PRINTER,

WIN_PRINTFILERAW(WIN_PRINTERGETDEFAULT(),FILENAME,"PRINT OUT FORM SOFTWARE")

WHERE FILENAME IS THE VARIABLE CONTAINS NAME OF FILE WITH EXTENTION

THIS NOT WORK, NOTHING PRINTS ON PRINTER,

(2) I HAVE USE MOLDRUK.PRG TO PRINT, IT WORKS GOOD AND PRINTS WELL, BUT IT DISTURBS THE DISPLAY OF MY SOFTWARE,

SUPPOSE THAT I HAVE DRAW LINES AND BOXES USING DIFFERENT COLORS, BUT SOFTWARE DISPLAYS BOXES OF SOME OTHER CHARACTERS, LIKE "?"

PLEASE HELP

Re: problem in printing function

Posted: Tue Apr 09, 2013 2:24 pm
by Rathinagiri
It will be better if you use the HMG print functions. It has many options.

If you have to print from Grid or Array, you can use HFCL gridprint function to directly print to win printers.

Re: problem in printing function

Posted: Mon May 05, 2014 1:54 am
by Javier Tovar
Hola Rathinagiri,

Tratando de limpiar mi PC de archivos obsoletos y conservar los archivos buenos; trato de compilar el ejemplo que viene en HFCL el ejemplo de GridPrint pero me sale este error:

Code: Select all

Harbour 3.2.0dev (r1312060701)
Copyright (c) 1999-2013, http://harbour-project.org/
C:/hmg.3.2/lib/libhfcl.a(GridPrint.o):GridPrint.c:(.data+0x758): undefined reference to `HB_FUN_ISCONTROLDEFINE'
collect2: ld returned 1 exit status
hbmk2: Error: Ejecutando enlazador. 1
gcc.exe C:/Users/MAQUIN~1/AppData/Local/Temp/hbmk_nbuyq6.dir/main.o C:/Users/MAQUIN~1/AppData/Local/Temp/hbmk_nbuyq6.dir/hbmk_jsavmj.o C:/hmg.3.2/Mios/GridPrint/_temp.o    -Wl,--nxcompat -Wl,--dynamicbase -mwindows -Wl,--start-group -lhmg -lcrypt -ledit -leditex -lgraph -lhfcl -lini -lreport -lmsvfw32 -lvfw32 -lhbct -lhbwin -lhbmzip -lminizip -lhbmemio -lhbmisc -lhbmysql -lmysql -lhbtip -lsqlite3 -lhbsqlit3 -lsddodbc -lrddsql -lsddmy -lhbodbc -lodbc32 -lhbhpdf -lhbfimage -lhbpgsql -lhbnetio -lxhb -lpng -llibhpdf -lhbvpdf -lhbzebra -lhbextern -lhbdebug -lhbvmmt -lhbrtl -lhblang -lhbcpage -lgtcgi -lgtpca -lgtstd -lgtwin -lgtwvt -lgtgui -lhbrdd -lhbuddall -lhbusrrdd -lrddntx -lrddcdx -lrddnsx -lrddfpt -lhbrdd -lhbhsx -lhbsix -lhbmacro -lhbcplr -lhbpp -lhbcommon -lhbmainwin -lkernel32 -luser32 -lgdi32 -ladvapi32 -lws2_32 -lwinspool -lcomctl32 -lcomdlg32 -lshell32 -luuid -lole32 -loleaut32 -lmpr -lwinmm -lmapi32 -limm32 -lmsimg32 -lwininet -lhbpcre -lhbzlib   -Wl,--end-group -omain.exe  -LC:/hmg.3.2/harbour/lib/win/mingw -LC:/hmg.3.2/lib

hbmk2: Error: Funci¢n(es) referenciada, no encontrada, pero desconocida:
       ISCONTROLDEFINE()

Y lo compilo con la versión HMG.3.1.5 y si se compila bien!. Ya se había tratado este problema?

Saludos
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


Hello Rathinagiri ,

Trying to clean my PC for obsolete files and keep good records ; I try to compile the example that comes in the example of HFCL GRIDprint but I get this error:

Code: Select all

Harbour 3.2.0dev ( r1312060701 )
Copyright ( c ) 1999-2013 , http://harbour-project.org/" onclick="window.open(this.href);return false;
C :/ hmg.3.2/lib/libhfcl.a ( GridPrint.o ) GridPrint.c : ( . Data +0 x758 ) : undefined reference to ` HB_FUN_ISCONTROLDEFINE '
collect2 : ld returned 1 exit status
hbmk2 : Error : Running linker. 1
gcc.exe C :/ Users / ~ 1/AppData/Local/Temp/hbmk_nbuyq6.dir/main.o MAQUIN C :/ Users / ~ 1/AppData/Local/Temp/hbmk_nbuyq6.dir/hbmk_jsavmj.o C :/ MAQUIN hmg.3.2/Mios/GridPrint/_temp.o -Wl, - NXCOMPAT -Wl, - DynamicBase - mwindows -Wl, - start -group- lcrypt - lhmg - ledit - leditex - lgraph - lhfcl - lini - lreport - lmsvfw32 - lvfw32 - lhbct - lhbwin - lhbmzip - lminizip - lhbmemio - lhbmisc - lhbmysql - lmysql - lhbtip - lsqlite3 - lhbsqlit3 - lsddodbc - lrddsql - lsddmy - lhbodbc - lodbc32 - lhbhpdf - lhbfimage - lhbpgsql - lhbnetio - lxhb - lpng - llibhpdf - lhbvpdf - lhbzebra - lhbextern - lhbdebug - lhbvmmt - lhbrtl - lhblang - lhbcpage - lgtcgi - lgtpca - lgtstd - lgtwin - lgtwvt - lgtgui - lhbrdd - lhbuddall - lhbusrrdd - lrddntx - lrddcdx - lrddnsx - lrddfpt - lhbrdd - lhbhsx - lhbsix - lhbmacro - lhbcplr - lhbpp - lhbcommon - lhbmainwin - lkernel32 - luser32 - lgdi32 - ladvapi32 - lws2_32 - lwinspool - lcomctl32 - lcomdlg32 - lshell32 - luuid - lole32 - loleaut32 - lmpr - lwinmm - lmapi32 - limm32 - lmsimg32 - lwininet - lhbpcre - lhbzlib -Wl, - end -group- omain.exe -LC -LC :/ :/ hmg.3.2/harbour/lib/win/mingw hmg.3.2/lib

hbmk2 : Error: Function ¢ n (s ) referenced , not found , but unknown :
       ISCONTROLDEFINE ( )
?
And I compile with HMG.3.1.5 version and it compiles fine ! . He had already dealt with this problem?

regards

Re: problem in printing function

Posted: Mon May 05, 2014 2:52 am
by Rathinagiri
I will check up and come back. Thanks for the report.

Re: problem in printing function

Posted: Mon May 05, 2014 4:36 am
by srvet_claudio
Rathinagiri wrote:I will check up and come back. Thanks for the report.
Hi Rathi,
please check in GridPrint.prg and GridPDF.prg files of HFCL,

where it says:
IsControlDefine

should say:
IsControlDefined

Re: problem in printing function

Posted: Mon May 05, 2014 5:33 am
by mol
I'm still using such a construction and it works OK for me:

Code: Select all

TmpPrintFile := TempFile(kat_TMP,"tmp",0)
set printer to &TmpPrintFile
set device to print
setprc(0,0)
@ prow(), pcol() say "Here is something to print..."
set printer to
set device to screen
WIN_PRINTFILERAW( WIN_PRINTERGETDEFAULT(), TmpPrintFile , "text mode printing job")
	
*----------------
function TempFile
	param cFolder, cExt, nFileAttr
	local cFileName, nHandle
	cFileName := cFolder+ if(right(cFolder,1)<>"\","\","")+strtran(str(numxor(val(dtos(date())),seconds()),8)," ","0")+"."+cExt
return cFileName
*---------------

Re: problem in printing function

Posted: Mon May 05, 2014 6:13 am
by bpd2000
mol wrote:I'm still using such a construction and it works OK for me:

Code: Select all

TmpPrintFile := TempFile(kat_TMP,"tmp",0)
set printer to &TmpPrintFile
set device to print
setprc(0,0)
@ prow(), pcol() say "Here is something to print..."
set printer to
set device to screen
WIN_PRINTFILERAW( WIN_PRINTERGETDEFAULT(), TmpPrintFile , "text mode printing job")
	
*----------------
function TempFile
	param cFolder, cExt, nFileAttr
	local cFileName, nHandle
	cFileName := cFolder+ if(right(cFolder,1)<>"\","\","")+strtran(str(numxor(val(dtos(date())),seconds()),8)," ","0")+"."+cExt
return cFileName
*---------------
Dear Mol
How to send print to Virtual printer i.e. DOS2USB
I could not test with above code, what changes require because dos2usb does not show in printer's list

Re: problem in printing function

Posted: Mon May 05, 2014 7:22 am
by mol
bpd2000 wrote: Dear Mol
How to send print to Virtual printer i.e. DOS2USB
I could not test with above code, what changes require because dos2usb does not show in printer's list
I don't know DOS2USB application.
You don't need this software, I think.
When you capture your printout by

Code: Select all

set device to print
set printer to &TmpPrintFile
everything you send to printer is captured to TmpPrintFile.
Then, you can send it to any windows printer by WIN_PRINTFILERAW.
You must remember to send control codes (PCL language for hp and almost all laser printers, ESC-P for dot matrix).
When your printer does not support control codes (DGI printers where whole job is preprocessed on computer), you can use MOLPrint.exe (I've posted whole code some years ago).

I hope this information was useful for you...

Re: problem in printing function

Posted: Mon May 05, 2014 8:50 am
by bpd2000
Thank you Mol for your guidance
Regards

Re: problem in printing function

Posted: Mon May 05, 2014 5:02 pm
by Javier Tovar
srvet_claudio wrote:Hi Rathi,
please check in GridPrint.prg and GridPDF.prg files of HFCL,

where it says:
IsControlDefine

should say:
IsControlDefined
+1