Microsoft DirectX 8.1 (C++)

IDirectPlayVoiceClient::Initialize

Initializes the DirectPlayVoiceClient object by associating it with a DirectPlay object. Additionally, this method registers a message handler with the DirectPlayVoiceClient object.

This method must be called successfully before IDirectPlayVoiceClient::Connect method is called.

HRESULT Initialize(
LPUNKNOWN pVoid,
PDVMESSAGEHANDLER pMessageHandler,
PVOID pUserContext,
PDWORD pdwMessageMask,
DWORD dwMessageMaskElements
);

Parameters

pVoid
[in] Pointer to the IUnknown interface for the DirectPlay object that this DirectPlayVoiceClient object should use.
pMessageHandler
[in] User-defined callback function that is called when there is a DirectPlayVoiceClient message to be processed. Threads within the DirectPlayVoiceClient object call the callback function, so it will not be called in the context of your process's main thread.
pUserContext
[in] Pointer to an application-defined structure that is passed to the callback function each time the function is called.
pdwMessageMask
[in] Array of DWORDs that contain the message identifiers that you want DirectPlay Voice to send to your callback function. If a message identifier is not specified in this array, it is not sent. Each message identifier should appear only once in the array and only valid message identifiers are allowed. For example, DVMSGID_CONNECTRESULT is not valid for the server interface, but is for the client interface. To enable all messages, specify NULL for this value.
dwMessageMaskElements
[in] Number of elements specified in the pdwMessageMask parameter. If pdwMessageMask is NULL, this must be 0.

Return Values

Returns DV_OK if successful, or one of the following error values.

DVERR_ALREADYINITIALIZED
DVERR_GENERIC
DVERR_INVALIDPARAM
DVERR_INVALIDPOINTER
DVERR_NOCALLBACK
DVERR_TRANSPORTNOTINIT

Remarks

You can call IDirectPlayVoiceClient::SetNotifyMask to change the notify mask during the course of the voice session.

Requirements

  Windows NT/2000/XP: Available as a redistributable for Windows 2000 and later.
  Windows 98/Me: Available as a redistributable for Windows 98 and later.
  Header: Declared in Dvoice.h.