Hardware Reference
In-Depth Information
Figure 6.10 Output produced by the inpout32.dll Visual Basic demonstration
program
As a further example, this PowerBASIC for Windows program is a complete
port test utility routine that uses inpout.dll as a means of accessing the parallel
ports:
'===========================================================
' Program Name: porttest.bas Language: Power BASIC 7.0
' Function: Writes data to the selected parallel port
' Notes: Requires inpout32.dll
'===========================================================
#COMPILE EXE
'-----------------------------------------------------------
DECLARE FUNCTION pbINP LIB "inpout32.dll" ALIAS "Inp32" _
(BYVAL PortAddress AS INTEGER) AS INTEGER
DECLARE SUB pbOUT LIB "inpout32.dll" ALIAS "Out32" _
(BYVAL PortAddress AS INTEGER, BYVAL Value AS INTEGER)
'-----------------------------------------------------------
%IDOK = 1
%IDCANCEL = 2
%IDTEXT = 100
%IDLABEL = 144
%IDSTATUS = 145
%BN_CLICKED = 0
%BS_DEFAULT = 1
%MF_ENABLED = 0
%MF_CHECKED = 8
%MF_UNCHECKED = 0
%WM_COMMAND = &H111
%ID_LPT1 = 401
%ID_LPT2 = 402
%ID_LPT3 = 403
%ID_HELP = 404
%ID_ABOUT = 405
'-----------------------------------------------------------
GLOBAL gsUserInput AS STRING
GLOBAL current_port AS INTEGER
GLOBAL hMenu AS DWORD
GLOBAL hDlg AS DWORD
GLOBAL lResult AS LONG
'-----------------------------------------------------------
CALLBACK FUNCTION OkButton()
Search WWH ::




Custom Search