IAsyncMessage::Write

Description

Writes data to device asynchronously. The data is passed in an array of bytes.

The write operation asynchronously transfers data. The data to be written is in the buffer represented by buf. This operation normally returns before the transfer terminates. An I/O Completion event will be posted when the transfer is actually completed.

The operation returns jobId, which you can use either with Terminate to abort the operation, or with an I/O Completion event to identify which asynchronous write operation completed.

VB Prototype

value As Long = Write(
  buffer As SAFEARRAY(BYTE),
  count As Long
)

C++ Prototype

HRESULT Write(
  SAFEARRAY(BYTE)* buffer,
  long count,
  long* pJobId
);

Parameters

buffer

The I/O Data to write in a SAFEARRAY of bytes.

count

The number of bytes to write.

pJobId

This job ID can be used to terminate the operation or to identify the event object resulting from this call.

Return Value

Refer to the table of return codes.

See Also

ComponentVersion, SpecVersion, HardwareInterfaceName, HardwareInterfaceNumber, HardwareInterfaceType, LockState, OptionString, ProgID, ResourceName, SessionType, SoftwareManufacturerID, SoftwareManufacturerName, Timeout, LastStatus, IOProtocol, SendEndEnabled, TerminationCharacter, TerminationCharacterEnabled, GetAttribute, SetAttribute, LockRsrc, UnlockRsrc, Init, Close, AssertTrigger, Clear, ReadSTB, Read, Write, WriteString, Terminate, IAsyncMessage Overview