# nfxCreateQueue

Creates a queue for either sending or receiving fax documents.

#### Prototype

DWORD nfxCreateQueue ( CTAHD ctahd, int queue_type, NFX_QUEUE_HANDLE *ptr_queue_handle)

Argument | Description
ctahd | Context handle returned by ctaCreateContext.
queue_type | Type of document queue (either NFX_DOC_RECEIVE or NFX_DOC_TRANSMIT).
ptr_queue_handle | Pointer to a location to receive a valid queue handle.

#### Return values

Return value | Description
SUCCESS |
CTAERR_BAD_ARGUMENT | Invalid function argument passed.
CTAERR_INVALID_CTAHD | The specified context handle is invalid.
CTAERR_INVALID_HANDLE | The specified document queue handle is invalid.
CTAERR_OUT_OF_MEMORY | Memory allocation failed.
NFXERR_OPEN_QUEUE_FAILED | An error occurred while accessing a document queue.

#### Events

None.

#### Details

The document queue data structure is maintained internally by NaturalFax and returns a handle to use with all other NaturalFax functions. Each document queue is associated with a specified context. Subsequent calls to nfxEnqueueDoc, nfxDestroyQueue, nfxSendFax, nfxReceiveFax, or nfxAnswerFaxPoll verify that the document queue is associated with the same context as the current operation.

You can associate more than one document queue with a given context, but you can associate only one send queue and one receive queue with an active fax session. For example, to send multiple queues, you call nfxSendFax for each queue.

Refer to Using document queues for more information.

#### See also

nfxDestroyQueue, nfxEnqueueDoc