プリンターを列挙するプロセスを開始します。
構文:
call "PC_PRINTER_ENUM_START" using by reference enum-handle
by value enum-flags
by reference number-of-printers-found
パラメーター
- enum-handle
- 呼び出しプロトタイプ (「説明の読み方」を参照):cblt-pointer
- PIC:pointer
- enum-flags
- 呼び出しプロトタイプ (「説明の読み方」を参照):cblt_os_flags
- PIC:pic x(4) comp-5 または pic x(8) comp-5 (64 ビットのネイティブのみ)
- number-of-printers-found
- 呼び出しプロトタイプ (「説明の読み方」を参照):cblt_os_size
- PIC:pic x(4) comp-5 または pic x(8) comp-5 (64 ビットのネイティブのみ)
入力パラメーター:
- enum-handle
- 未設定
- enum-flags
- 呼び出しの動作を制御するフラグ。値は常に 0
- number-of-printers-found
- 未設定
出力パラメーター:
- enum-handle
- プリンター数が 0 より大きい場合に有効な列挙ハンドル
- number-of-printers-found
- 見つかったプリンターの数
- return-value
- 次のいずれかになります。
- 0
- 列挙が開始されました
- != 0
- PC_PRINTER エラー コード
例
01 enum-handle pointer.
01 printer-name.
03 p-name-len pic x(2) comp-5.
03 p-name pic x(255).
01 enum-flags pic x(4) comp-5 value 0.
01 enum-printers-found pic x(4) comp-5 value 0.
01 p-counter binary-long.
procedure division.
move 1 to p-counter
set p-name-len to length of p-name
call "PC_PRINTER_ENUM_START" using
by reference enum-handle
by value enum-flags
by reference enum-printers-found
end-call
if return-code not equal 0
display "RC: Enum-Start : " return-code
end-if
display "Printers found : " enum-printers-found
perform until return-code not equal 0
set p-name-len to length of p-name
call "PC_PRINTER_ENUM_NEXT" using
by value enum-handle
by reference printer-name
end-call
if return-code not equal 0
display "RC: Enum-Next : " return-code
else
display p-counter " " p-name(1:p-name-len)
" size " p-name-len
end-if
add 1 to p-counter
end-perform
call "PC_PRINTER_ENUM_CLOSE" using
by reference enum-handle
end-call