IBidiSpl::BindDevice method

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

Syntax

HRESULT BindDevice(
  const LPCWSTR pszDeviceName,
  const DWORD   dwAccess
);

Parameters

pszDeviceName

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

dwAccess

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

Value Meaning
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. For more information about COM error codes, see Error Handling.

Value Description
S_OK
The operation was successfully carried out.
E_HANDLE
The interface handle was invalid.
None of the above
The HRESULT contains an error code corresponding to the last error.

Requirements

   
Minimum supported client Windows XP
Minimum supported server Windows Server 2003
Target Platform Desktop
Header bidispl.h
DLL Bidispl.dll

See Also

Bidirectional Communication Interfaces

Bidirectional Communication Schema

IBidiSpl

OpenPrinter