IsPrinter() & XP
IsPrinter() & XP
I still use some clipper applications but have problem with IsPrinter() function becouse under XP it always return .T.
Some solution please ?
Best regards,
p.s
1. If someone have problems with 100% used procesor when start clipper application to release it look for library OSLIB.LIB and use function
OL_AutoYield(.t.)
2. If clipper application print verry slow... starting to print after 15-20 seconds:
START REGEDIT
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\WOW
on LPT_Timeout put data 1
it mean start printing after 1 second.
Some solution please ?
Best regards,
p.s
1. If someone have problems with 100% used procesor when start clipper application to release it look for library OSLIB.LIB and use function
OL_AutoYield(.t.)
2. If clipper application print verry slow... starting to print after 15-20 seconds:
START REGEDIT
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\WOW
on LPT_Timeout put data 1
it mean start printing after 1 second.
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
You can use the Harbour's IsPrinter() source code to build your own MyIsPrinter():
http://harbour-project.svn.sourceforge. ... iew=markup
http://harbour-project.svn.sourceforge. ... iew=markup
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Here you have the harbour source code adapted for Borland C 16 bits and the generated OBJ. When you link your EXE it may require some missing external functions. Right now I have to go our of the office here, but when I get back I will help you with them:
isprint.c (Borland 16 bits)
Here is the OBJ:
http://rapidshare.com/files/136987435/i ... r.obj.html
Please notice that the funcion name is HB_ISPRINTER( [cPort] ) --> lYesNo and you can provide an optional parameter to it for the port to check.
isprint.c (Borland 16 bits)
Code: Select all
// Harbour isprinter.c adapted source code for Borland C 16 bits
#include <Winten.h>
#include <Windows.h>
#include <ClipApi.h>
int strnicmp( char *, char *, int );
int atoi( char * );
BOOL hb_printerIsReady( char * pszPrinterName )
{
BOOL bIsPrinter;
{
USHORT uiPort;
if( pszPrinterName == NULL )
pszPrinterName = "LPT1";
if( strnicmp( pszPrinterName, "PRN", 3 ) == 0 )
{
_AH = 2;
_DX = 0; /* LPT1 */
asm int 0x11; // 17
bIsPrinter = ( _AH == 0x90 );
}
else if( strlen( pszPrinterName ) >= 4 &&
strnicmp( pszPrinterName, "LPT", 3 ) == 0 &&
( uiPort = atoi( pszPrinterName + 3 ) ) > 0 )
{
_DX = uiPort - 1;
_AH = 2;
asm int 0x11; // 17
bIsPrinter = ( _AH == 0x90 );
}
else
bIsPrinter = FALSE;
}
return bIsPrinter;
}
void pascal HB_ISPRINTER( void )
{
_retl( hb_printerIsReady( _parc( 1 ) ) );
}
http://rapidshare.com/files/136987435/i ... r.obj.html
Please notice that the funcion name is HB_ISPRINTER( [cPort] ) --> lYesNo and you can provide an optional parameter to it for the port to check.
Last edited by Antonio Linares on Wed Aug 13, 2008 2:11 pm, edited 1 time in total.
Hi Antonio,
Please check it ... and thanks
C:\verzii\aaa>blinker fi proba,isprinter
__ __
(«») («») BLINKER Dynamic Overlay Linker 1.00 for CA-Clipper 5.3
⌂
___ Blink and you'll miss it !!
Copyright (c) Assembler Software Manufacturers, Inc. 1990 - 1995
All Rights Reserved. Licensed solely for use with CA-Clipper 5.3
BLINKER : 1115 : PROBA.OBJ(PROBA) : 'HB_ISPRINT' : unresolved external
BLINKER : 1115 : ISPRINTER.OBJ(ISPRINTER) : '_ATOI' : unresolved external
BLINKER : 1115 : ISPRINTER.OBJ(ISPRINTER) : '_STRNICMP' : unresolved external
BLINKER : 0 Warning error(s), 3 Fatal error(s)
PROBA.EXE (not created) (0.1 seconds)
best regards,
Please check it ... and thanks
C:\verzii\aaa>blinker fi proba,isprinter
__ __
(«») («») BLINKER Dynamic Overlay Linker 1.00 for CA-Clipper 5.3
⌂
___ Blink and you'll miss it !!
Copyright (c) Assembler Software Manufacturers, Inc. 1990 - 1995
All Rights Reserved. Licensed solely for use with CA-Clipper 5.3
BLINKER : 1115 : PROBA.OBJ(PROBA) : 'HB_ISPRINT' : unresolved external
BLINKER : 1115 : ISPRINTER.OBJ(ISPRINTER) : '_ATOI' : unresolved external
BLINKER : 1115 : ISPRINTER.OBJ(ISPRINTER) : '_STRNICMP' : unresolved external
BLINKER : 0 Warning error(s), 3 Fatal error(s)
PROBA.EXE (not created) (0.1 seconds)
best regards,
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
This OBJ fixes the function name:
http://rapidshare.com/files/137038224/i ... r.obj.html
Please use it as HB_PRINT().
Next I help you to solve those two unresolved externals
http://rapidshare.com/files/137038224/i ... r.obj.html
Please use it as HB_PRINT().
Next I help you to solve those two unresolved externals
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Much simpler
From your PRG use it this way:
MsgInfo( IsPrn( 1 ) ) // checks LPT1
MsgInfo( IsPrn( 2 ) ) // checks LPT2
...
Here you have the OBJ:
http://rapidshare.com/files/137047090/i ... r.obj.html
Code: Select all
#include <ClipApi.h>
void pascal ISPRN( void )
{
_DX = _parni( 1 ) - 1;
_AH = 2;
asm int 0x11; // 17
_retl( _AL == 0x90 );
}
MsgInfo( IsPrn( 1 ) ) // checks LPT1
MsgInfo( IsPrn( 2 ) ) // checks LPT2
...
Here you have the OBJ:
http://rapidshare.com/files/137047090/i ... r.obj.html
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
There was an error in my code:
http://www.ctyme.com/intr/rb-2100.htm
This is the right code:
And here you have the OBJ:
http://rapidshare.com/files/137243032/i ... r.obj.html
You have to use it the same way
http://www.ctyme.com/intr/rb-2100.htm
This is the right code:
Code: Select all
#include <ClipApi.h>
void pascal ISPRN( void )
{
_DX = _parni( 1 ) - 1;
_AH = 2;
asm int 0x17;
_retl( _AL == 0x90 );
}
http://rapidshare.com/files/137243032/i ... r.obj.html
You have to use it the same way
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Then lets try another way:
Code: Select all
#include "FiveWin.ch"
function IsPrn()
local lResult, oPrn
PRINT oPrn
lResult = ! Empty( oPrn:hDC )
ENDPRINT
return lResult
C:\verzii\aaa>D:BLINKER FI PROBA
__ __
(«») («») BLINKER Dynamic Overlay Linker 1.00 for CA-Clipper 5.3
⌂
___ Blink and you'll miss it !!
Copyright (c) Assembler Software Manufacturers, Inc. 1990 - 1995
All Rights Reserved. Licensed solely for use with CA-Clipper 5.3
BLINKER : 1115 : PROBA.OBJ(PROBA) : 'PRINTBEGIN' : unresolved external
BLINKER : 1115 : PROBA.OBJ(PROBA) : 'PRINTEND' : unresolved external
BLINKER : 0 Warning error(s), 2 Fatal error(s)
PROBA.EXE (not created) (0.1 seconds)
________________________________
Regards and thanks for time Antonio,
__ __
(«») («») BLINKER Dynamic Overlay Linker 1.00 for CA-Clipper 5.3
⌂
___ Blink and you'll miss it !!
Copyright (c) Assembler Software Manufacturers, Inc. 1990 - 1995
All Rights Reserved. Licensed solely for use with CA-Clipper 5.3
BLINKER : 1115 : PROBA.OBJ(PROBA) : 'PRINTBEGIN' : unresolved external
BLINKER : 1115 : PROBA.OBJ(PROBA) : 'PRINTEND' : unresolved external
BLINKER : 0 Warning error(s), 2 Fatal error(s)
PROBA.EXE (not created) (0.1 seconds)
________________________________
Regards and thanks for time Antonio,
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact: