home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / ni_vb / nwpserv.bas < prev    next >
BASIC Source File  |  1993-06-03  |  10KB  |  205 lines

  1. 'NWPSERV.BAS  NetWare Print Server Services Interface for Visual Basic For Windows
  2. 'Version 1.0
  3. 'Novell Systems Research Department, Novell, Inc.
  4. 'Copyright (c) 1993, Novell, Inc.
  5. 'This interface is not supported through Novell's regular
  6. 'support channels.  See README.TXT for more information.
  7.  
  8. 'Print server status
  9. Global Const RUNNING = 0
  10. Global Const GOING_DOWN = 1
  11. Global Const DOWN = 2
  12. Global Const INITIALIZING = 3
  13.  
  14. 'Printer status
  15. Global Const PRINTER_RUNNING = 0
  16. Global Const PRINTER_OFFLINE = 1
  17. Global Const PRINTER_PAPER_OUT = 2
  18.  
  19. 'printControlFlags
  20. Global Const SUPPRESS_FF = &H800
  21. Global Const NOTIFY_USER = &H1000
  22. Global Const TEXT_MODE = &H4000
  23. Global Const PRINT_BANNER = &H8000
  24.  
  25. 'Queue service modes
  26. Global Const QUEUE_ONLY = 0
  27. Global Const QUEUE_BEFORE_FORM = 1
  28. Global Const FORM_ONLY = 2
  29. Global Const FORM_BEFORE_QUEUE = 3
  30.  
  31. 'Port configuration values
  32. Global Const BAUD_RATE_0300 = 0
  33. Global Const BAUD_RATE_0600 = 1
  34. Global Const BAUD_RATE_1200 = 2
  35. Global Const BAUD_RATE_2400 = 3
  36. Global Const BAUD_RATE_4800 = 4
  37. Global Const BAUD_RATE_9600 = 5
  38.  
  39. Global Const STOP_BITS_1 = 0
  40. Global Const STOP_BITS_1_5 = 1
  41. Global Const STOP_BITS_2 = 2
  42.  
  43. Global Const PARITY_NONE = 0
  44. Global Const PARITY_EVEN = 1
  45. Global Const PARITY_ODD = 2
  46.  
  47. 'Printer types
  48. Global Const P_PAR_1 = 0
  49. Global Const P_PAR_2 = 1
  50. Global Const P_PAR_3 = 2
  51. Global Const P_SER_1 = 3
  52. Global Const P_SER_2 = 4
  53. Global Const P_SER_3 = 5
  54. Global Const P_SER_4 = 6
  55. Global Const P_REM_PAR_1 = 7
  56. Global Const P_REM_PAR_2 = 8
  57. Global Const P_REM_PAR_3 = 9
  58. Global Const P_REM_SER_1 = 10
  59. Global Const P_REM_SER_2 = 11
  60. Global Const P_REM_SER_3 = 12
  61. Global Const P_REM_SER_4 = 13
  62. Global Const P_REM_OTHER = 14
  63. Global Const P_ELSEWHERE = 15
  64.  
  65. 'ObjectType for job owner (for notify object APIs)
  66. Global Const JOB_OWNER = -1
  67.  
  68. 'Job outcomes
  69. Global Const PLACE_ON_HOLD = 0
  70. Global Const RETURN_TO_QUEUE = 1
  71. Global Const THROW_AWAY = 2
  72.  
  73. 'Remote printer modes
  74. Global Const REMOTE_SHARED = 0
  75. Global Const REMOTE_PRIVATE = 1
  76.  
  77. 'Printer status
  78. Global Const PSTAT_WAITING_FOR_JOB = 0
  79. Global Const PSTAT_WAITING_FOR_FORM = 1
  80. Global Const PSTAT_PRINTING_JOB = 2
  81. Global Const PSTAT_PAUSED = 3
  82. Global Const PSTAT_STOPPED = 4
  83. Global Const PSTAT_MARK_EJECT = 5
  84. Global Const PSTAT_READY_TO_GO_DOWN = 6
  85. Global Const PSTAT_NOT_CONNECTED = 7
  86. Global Const PSTAT_PRIVATE = 8
  87.  
  88. 'Print server communication errors
  89. Global Const PSC_NO_AVAILABLE_SPX_CONNECTS = &H40
  90. Global Const PSC_SPX_NOT_INITIALIZED = &H41
  91. Global Const PSC_NO_SUCH_PRINT_SERVER = &H42
  92. Global Const PSC_UNABLE_TO_GET_SERVER_ADDR = &H43
  93. Global Const PSC_UNABLE_TO_CONNECT_TO_SERVER = &H44
  94. Global Const PSC_NO_AVAILABLE_IPX_SOCKETS = &H45
  95. Global Const PSC_ALREADY_ATTACHED_TO_PSERVER = &H46
  96. Global Const PSC_IPX_NOT_INITIALIZED = &H47
  97.  
  98. 'Print server error codes
  99. Global Const PSE_TOO_MANY_FILE_SERVERS = &H101
  100. Global Const PSE_UNKNOWN_FILE_SERVER = &H102
  101. Global Const PSE_BINDERY_LOCKED = &H103
  102. Global Const PSE_SERVER_MAXED_OUT = &H104
  103. Global Const PSE_NO_RESPONSE = &H105
  104. Global Const PSE_ALREADY_ATTACHED = &H106
  105. Global Const PSE_CANT_ATTACH = &H107
  106. Global Const PSE_NO_ACCOUNT_BALANCE = &H108
  107. Global Const PSE_NO_CREDIT_LEFT = &H109
  108. Global Const PSE_INTRUDER_DETECTION_LOCK = &H10A
  109. Global Const PSE_TOO_MANY_CONNECTIONS = &H10B
  110. Global Const PSE_ACCOUNT_DISABLED = &H10C
  111. Global Const PSE_UNAUTHORIZED_TIME = &H10D
  112. Global Const PSE_UNAUTHORIZED_STATION = &H10E
  113. Global Const PSE_NO_MORE_GRACE = &H10F
  114. Global Const PSE_LOGIN_DISABLED = &H110
  115. Global Const PSE_ILLEGAL_ACCT_NAME = &H111
  116. Global Const PSE_PASSWORD_HAS_EXPIRED = &H112
  117. Global Const PSE_ACCESS_DENIED = &H113
  118. Global Const PSE_CANT_LOGIN = &H114
  119. Global Const PSE_NO_SUCH_QUEUE = &H200
  120. Global Const PSE_NOT_AUTHORIZED_FOR_QUEUE = &H201
  121. Global Const PSE_QUEUE_HALTED = &H202
  122. Global Const PSE_UNABLE_TO_ATTACH_TO_QUEUE = &H203
  123. Global Const PSE_TOO_MANY_QUEUE_SERVERS = &H204
  124. Global Const PSE_INVALID_REQUEST = &H300
  125. Global Const PSE_NOT_ENOUGH_MEMORY = &H301
  126. Global Const PSE_NO_SUCH_PRINTER = &H302
  127. Global Const PSE_INVALID_PARAMETER = &H303
  128. Global Const PSE_PRINTER_BUSY = &H304
  129. Global Const PSE_CANT_DETACH_PRIMARY_SERVER = &H305
  130. Global Const PSE_GOING_DOWN = &H306
  131. Global Const PSE_NOT_CONNECTED = &H307
  132. Global Const PSE_ALREADY_IN_USE = &H308
  133. Global Const PSE_NO_JOB_ACTIVE = &H309
  134. Global Const PSE_NOT_ATTACHED_TO_SERVER = &H30A
  135. Global Const PSE_ALREADY_IN_LIST = &H30B
  136. Global Const PSE_DOWN = &H30C
  137. Global Const PSE_NOT_IN_LIST = &H30D
  138. Global Const PSE_NO_RIGHTS = &H30E
  139. Global Const PSE_UNABLE_TO_VERIFY_IDENTITY = &H400
  140. Global Const PSE_NOT_REMOTE_PRINTER = &H401
  141.  
  142. 'Client privilege levels for print server
  143. Global Const PS_LIMITED = 0                ' Limited access only
  144. Global Const PS_USER = 1                   ' User access
  145. Global Const PS_OPERATOR = 2               ' Operator access
  146.  
  147.  
  148. Type PS_INFO
  149.     status As String * 1
  150.     numPrinters As String * 1
  151.     numModes As String * 1
  152.     majorVersion As String * 1
  153.     minorVersion As String * 1
  154.     revision As String * 1
  155.     serialNumber As String * 4
  156.     serverType As String * 1
  157. End Type
  158.  
  159. Type REMOTE_INFO
  160.     printerType As Integer
  161.     useInterrupts As Integer
  162.     irqNumber As Integer
  163.     numBlocks As Integer
  164.     useXonXoff As Integer
  165.     baudRate As Integer
  166.     dataBits As Integer
  167.     stopBits As Integer
  168.     parity As Integer
  169.     socket As Integer
  170. End Type
  171.  
  172. Declare Function PSAbortPrintJob Lib "NWPSERV.DLL" (ByVal spxConn%, ByVal printer%, ByVal jobOutcome%) As Integer
  173. Declare Function PSAddNotifyObject Lib "NWPSERV.DLL" (ByVal spxConn%, ByVal printer%, ByVal fileServer$, ByVal objectName$, ByVal objectType%, ByVal firstNotif%, ByVal nextNotif%) As Integer
  174. Declare Function PSAddQueueToPrinter Lib "NWPSERV.DLL" (ByVal spxConn%, ByVal printer%, ByVal fileServer$, ByVal queue$, ByVal priority%) As Integer
  175. Declare Function PSAttachPrintServerToFileServer Lib "NWPSERV.DLL" (ByVal spxConn%, ByVal fileServer$, ByVal password$) As Integer
  176. Declare Function PSAttachToPrintServer Lib "NWPSERV.DLL" (ByVal printServerName$, connectionID%) As Integer
  177. Declare Function PSCancelDownRequest Lib "NWPSERV.DLL" (ByVal spxConn%) As Integer
  178. Declare Function PSChangeNotifyInterval Lib "NWPSERV.DLL" (ByVal spxConn%, ByVal printer%, ByVal fileServer$, ByVal objectName$, ByVal objectType%, ByVal firstNotif%, ByVal nextNotif%) As Integer
  179. Declare Function PSChangeQueuePriority Lib "NWPSERV.DLL" (ByVal spxConn%, ByVal printer%, ByVal fileServer$, ByVal queue$, ByVal priority%) As Integer
  180. Declare Function PSChangeServiceMode Lib "NWPSERV.DLL" (ByVal spxConn%, ByVal printer%, ByVal serviceMode%) As Integer
  181. Declare Function PSDeleteNotifyObject Lib "NWPSERV.DLL" (ByVal spxConn%, ByVal printer%, ByVal fileServer$, ByVal objectName$, ByVal objectType%) As Integer
  182. Declare Function PSDeleteQueueFromPrinter Lib "NWPSERV.DLL" (ByVal spxConn%, ByVal printer%, ByVal fileServer$, ByVal queue$, ByVal immed%, ByVal jobOutcome%) As Integer
  183. Declare Function PSDetachFromPrintServer Lib "NWPSERV.DLL" (ByVal connID%) As Integer
  184. Declare Function PSDetachPrtServerFromFileServer Lib "NWPSERV.DLL" (ByVal spxConn%, ByVal fileServer$, ByVal immed%, ByVal jobOutcome%) As Integer
  185. Declare Function PSDownPrintServer Lib "NWPSERV.DLL" (ByVal spxConn%, ByVal immed%, ByVal jobOutcome%) As Integer
  186. Declare Function PSEjectForm Lib "NWPSERV.DLL" (ByVal spxConn%, ByVal printer%) As Integer
  187. Declare Function PSGetAttachedServers Lib "NWPSERV.DLL" (ByVal spxConn%, sequence%, ByVal fileServer$) As Integer
  188. Declare Function PSGetNextRemotePrinter Lib "NWPSERV.DLL" (ByVal spxConn%, printer%, printerType%, ByVal printerName$) As Integer
  189. Declare Function PSGetNotifyObject Lib "NWPSERV.DLL" (ByVal spxConn%, ByVal printer%, sequence%, ByVal fileServer$, ByVal objectName$, objectType%, firstNotif%, nextNotif%) As Integer
  190. 'printerList% must be initialized to maxPrinters% bytes
  191. Declare Function PSGetPrintersServicingQueue Lib "NWPSERV.DLL" (ByVal spxConn%, ByVal fileServer$, ByVal queue$, ByVal maxPrinter%, numPrinters%, printerList%) As Integer
  192. Declare Function PSGetPrinterStatus Lib "NWPSERV.DLL" (ByVal spxConn%, ByVal printer%, status%, problem%, hasJob%, serviceMode%, formNumber%, ByVal formName$, ByVal printerName) As Integer
  193. Declare Function PSGetPrintJobStatus Lib "NWPSERV.DLL" (ByVal spxConn%, ByVal printer%, ByVal fileServer$, ByVal queueName$, jobNumber%, ByVal jobDesc$, copiesToPrint%, jobSize&, copyiesDone%, bytesIntoCopy&, neededForm%, text%) As Integer
  194. Declare Function PSGetPrintServerInfo Lib "NWPSERV.DLL" (ByVal spxConn%, info As PS_INFO, ByVal size%) As Integer
  195. Declare Function PSGetQueuesServiced Lib "NWPSERV.DLL" (ByVal spxConn%, ByVal printer%, sequence%, ByVal fileServer$, ByVal queue$, priority%) As Integer
  196. Declare Function PSLoginToPrintServer Lib "NWPSERV.DLL" (ByVal spxConn%, clientAccessLevel%) As Integer
  197. Declare Function PSMarkTopOfForm Lib "NWPSERV.DLL" (ByVal spxConn%, ByVal printer%, ByVal character%) As Integer
  198. Declare Function PSRequestRemotePrinter Lib "NWPSERV.DLL" (ByVal spxConn%, printerInfo As REMOTE_INFO) As Integer
  199. Declare Function PSRewindPrintJob Lib "NWPSERV.DLL" (ByVal spxConn%, ByVal printer%, ByVal byPage%, ByVal relative%, ByVal copy%, ByVal offset&) As Integer
  200. Declare Function PSSetMountedForm Lib "NWPSERV.DLL" (ByVal spxConn%, ByVal printer%, ByVal formNumber%) As Integer
  201. Declare Function PSSetRemoteMode Lib "NWPSERV.DLL" (ByVal spxConn%, ByVal printer%, ByVal mode%) As Integer
  202. Declare Function PSStartPrinter Lib "NWPSERV.DLL" (ByVal spxConn%, ByVal printer%) As Integer
  203. Declare Function PSStopPrinter Lib "NWPSERV.DLL" (ByVal spxConn%, ByVal printer%, ByVal jobOutcome%) As Integer
  204.  
  205.