Antonio Linares wrote:Badara,
We can't tell you right now an exact printer model, but we have been reported through several years about printers that were not properly working under 16 bits, most of them USB printers.
METHOD New( cDocument, lUser, lMeta, cModel, lModal ) CLASS TPrinter
local aOffset
local cPrinter
DEFAULT cDocument := "FiveWin Report" ,;
lUser := .f. ,;
lMeta := .f. ,;
lModal := .f.
if lUser
::hDC := GetPrintDC( GetActiveWindow() )
if ::hDC != 0
cModel := ::GetModel()+","+::GetDriver()+","+::GetPort()
endif
elseif cModel == NIL
::hDC := GetPrintDefault( GetActiveWindow() )
if ::hDC != 0
cModel := ::GetModel()+","+::GetDriver()+","+::GetPort()
endif
else
cPrinter := GetProfString( "windows", "device" , "" )
WriteProfString( "windows", "device", cModel )
SysRefresh()
PrinterInit()
::hDC := GetPrintDefault( GetActiveWindow() )
SysRefresh()
WriteProfString( "windows", "device", cPrinter )
endif
if ::hDC != 0
aOffset := PrnOffset( ::hDC )
::nXOffset := aOffset[1]
::nYOffset := aOffset[2]
::nOrient := ::GetOrientation()
elseif ComDlgXErr() != 0
MsgStop( "There are no printers installed!" + CRLF + ;
"Please exit this application and install a printer." )
::nXOffset := 0
::nYOffset := 0
endif
::cDocument := cDocument
::cModel := cModel
::nPage := 0
::nPad := 0
::lMeta := lMeta
::lStarted := .F.
::lModified := .F.
::lPrvModal := lModal
if !lMeta
::hDcOut := ::hDC
else
::aMeta := {}
::cDir := GetEnv("TEMP")
if empty(::cDir)
::cDir := GetEnv("TMP")
endif
if Right( ::cDir, 1 ) == "\"
::cDir = SubStr( ::cDir, 1, Len( ::cDir ) - 1 )
endif
if !empty(::cDir)
if !lIsDir(::cDir)
::cDir := GetWinDir()
endif
else
::cDir := GetWinDir()
endif
endif
return Self
//----------------------------------------------------------------------------//
METHOD New( cDocument, lUser, lMeta, cModel, lModal) CLASS TPrinter
local aOffset
local cPrinter
LOCAL cPortDrv
DEFAULT cDocument := "Impression ICIM" ,;
lUser := .f. , ;
lMeta := .f. , ;
lModal := .f.
IF cModel = NIL
cModel := WinDefPrn()
ENDIF
cPortDrv := WinGetPrnP(cModel)
cModel := cModel + "," + cPortDrv
SysRefresh()
::hDC := CreateDC( TOKEN(cModel,",",2), ;
TOKEN(cModel,",",1), TOKEN(cModel,",",3))
SysRefresh()
if ::hDC != 0
aOffset := PrnOffset( ::hDC )
::nXOffset := aOffset[1]
::nYOffset := aOffset[2]
::nOrient := ::GetOrientation()
elseif ComDlgXErr() != 0
MsgStop( OemToAnsi("Aucune imprimante n'est installée ou accessible actuellement...") )
::nXOffset := 0
::nYOffset := 0
endif
::cDocument := cDocument
::cModel := cModel
::nPage := 0
::nPad := 0
::lMeta := lMeta
::lStarted := .F.
::lModified := .F.
::lPrvModal := lModal
if !lMeta
::hDcOut := ::hDC
else
::aMeta := {}
::cDir := GetEnv("TEMP")
if empty(::cDir)
::cDir := GetEnv("TMP")
endif
if Right( ::cDir, 1 ) == "\"
::cDir = LEFT( ::cDir, LEN( ::cDir ) - 1 )
endif
if !empty(::cDir)
if !lIsDir(::cDir)
::cDir := GetWinDir()
endif
else
::cDir := GetWinDir()
endif
endif
return Self
Return to FiveWin for CA-Clipper
Users browsing this forum: No registered users and 13 guests