'----------------------------------------------------------------
'Copyright 1994   Unger Business Systems  All Rights Reserved
'This code is distributed as shareware.  If you use it, you
'are required by law to register it.  Please contact Unger
'Business Systems at 11926 Barrett Brae, Houston, TX 77072-4004
'or call (713) 498-8517.  Registration fee is $20.00 US
'See the README.TXT file for more information
'
'All code, forms, modules, controls, etc. are provided without
'warranty or liability
'----------------------------------------------------------------

'type declarations used for GenPrinter

Type LOGFONT   ' 50 Bytes
   lfHeight As Integer
   lfWidth As Integer
   lfEscapement As Integer
   lfOrientation As Integer
   lfWeight As Integer
   lfItalic As String * 1
   lfUnderline As String * 1
   lfStrikeOut As String * 1
   lfCharSet As String * 1
   lfOutPrecision As String * 1
   lfClipPrecision As String * 1
   lfQuality As String * 1
   lfPitchAndFamily As String * 1
   lfFaceName As String * 32
End Type

Type POINTAPI  '4 Bytes
   x As Integer
   y As Integer
End Type

'  Logical Pen
Type LOGPEN    '10 Bytes
   lopnStyle As Integer
   lopnWidth As POINTAPI
   lopnColor As Long
End Type

Type DEVMODE    ' 68 Bytes
    dmDeviceName As String * 32
    dmSpecVersion As Integer
    dmDriverVersion As Integer
    dmSize As Integer
    dmDriverExtra As Integer
    dmFields As Long
    dmOrientation As Integer
    dmPaperSize As Integer
    dmPaperLength As Integer
    dmPaperWidth As Integer
    dmScale As Integer
    dmCopies As Integer
    dmDefaultSource As Integer
    dmPrintQuality As Integer
    dmColor As Integer
    dmDuplex As Integer
    dmYResolution As Integer
    dmTTOption As Integer
End Type

Type DOCINFO    ' 10 Bytes
   cbSize As Integer
   lpszDocName As Long
   lpszOutput As Long
End Type

Type RECT   '8 Bytes
   left As Integer
   top As Integer
   right As Integer
   bottom As Integer
End Type

Type SIZEAPI  '4 Bytes
   x As Integer
   y As Integer
End Type

Type TEXTMETRIC   '31 Bytes
   tmHeight As Integer
   tmAscent As Integer
   tmDescent As Integer
   tmInternalLeading As Integer
   tmExternalLeading As Integer
   tmAveCharWidth As Integer
   tmMaxCharWidth As Integer
   tmWeight As Integer
   tmItalic As String * 1
   tmUnderlined As String * 1
   tmStruckOut As String * 1
   tmFirstChar As String * 1
   tmLastChar As String * 1
   tmDefaultChar As String * 1
   tmBreakChar As String * 1
   tmPitchAndFamily As String * 1
   tmCharSet As String * 1
   tmOverhang As Integer
   tmDigitizedAspectX As Integer
   tmDigitizedAspectY As Integer
End Type

'external declarations used in VBGPRINT
Declare Sub agCopyDataBynum Lib "Apiguide.dll" Alias "agCopyData" (ByVal source&, ByVal dest&, ByVal nCount%)
Declare Function agGetAddressForObject& Lib "Apiguide.dll" (object As Any)
Declare Function agGetAddressForLPSTR& Lib "Apiguide.dll" Alias "agGetAddressForObject" (ByVal lpstring$)
Declare Function agGetAddressForVBString& Lib "Apiguide.dll" (vbstring$)
Declare Function agGetSTringFromLPSTR$ Lib "Apiguide.dll" (ByVal lpstring$)
Declare Function agDeviceCapabilities& Lib "Apiguide.dll" (ByVal hlib%, ByVal lpszDevice$, ByVal lpszPort$, ByVal fwCapability%, ByVal lpszOutput&, ByVal lpdm&)
Declare Function agExtDeviceMode% Lib "Apiguide.dll" (ByVal hWnd%, ByVal hDriver%, ByVal lpdmOutput&, ByVal lpszDevice$, ByVal lpszPort$, ByVal lpdmInput&, ByVal lpszProfile&, ByVal fwMode%)
Declare Function GetProfileString% Lib "Kernel" (ByVal lpAppName$, ByVal lpKeyName As Any, ByVal lpDefault$, ByVal lpReturnedString$, ByVal nSize%)
Declare Sub FreeLibrary Lib "Kernel" (ByVal hLibModule%)

