IBidiSpl2::BindDevice method (bidispl.h)

The BindDevice method binds a printer to a bidirectional printer communication (bidi communication) request. This method is similar to the OpenPrinter function.

Syntax

HRESULT BindDevice(
  [in] const LPCWSTR pszDeviceName,
  [in] const DWORD   dwAccess
);

Parameters

[in] pszDeviceName

A pointer to a null-terminated string that contains the name of the printer or print server. If NULL, this parameter indicates the local print server.

[in] dwAccess

The access privileges for the printer. This parameter can be one of the following values.

Value Description
BIDI_ACCESS_ADMINISTRATOR Permits users to perform all administrative tasks and basic printing operations except for SYNCHRONIZE. This is the same as PRINTER_ALL_ACCESS in OpenPrinter.
BIDI_ACCESS_USER Permits users to perform basic printing operations. This is the same as PRINTER_ACCESS_USE in OpenPrinter.

Return value

The method returns one of the following values.

Return code Description
S_OK The operation was successful.
E_HANDLE The interface handle is invalid.
None of the above The HRESULT contains an error code that corresponds to the last error.

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Desktop
Header bidispl.h
DLL Bidispl.dll

See also

Bidirectional Communication Interfaces

Bidirectional Communication Schema

IBidiSpl2

OpenPrinter

Print Spooler Components