Microsoft DirectX 9.0 SDK Update (Summer 2003) |
Initializes the DirectPlayVoiceClient object by associating it with a Microsoft® DirectPlay® object. Additionally, this method registers a message handler with the DirectPlayVoiceClient object.
Syntax
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 DWORD values that contains 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] DWORD value specifying the number of elements in the pdwMessageMask parameter. If pdwMessageMask is NULL, this must be 0.
Return Value
Returns DV_OK if successful, or one of the following error values.
DVERR_ALREADYINITIALIZED The object has already been initialized. DVERR_GENERIC An undefined error condition occurred. DVERR_INVALIDPARAM One or more of the parameters passed to the method are invalid. DVERR_INVALIDPOINTER The pointer specified is invalid. DVERR_NOCALLBACK This operation cannot be performed because no callback function was specified. DVERR_TRANSPORTNOTINIT The specified transport is not yet initialized.
Remarks
This method must be called successfully before IDirectPlayVoiceClient::Connect method is called.
You can call IDirectPlayVoiceClient::SetNotifyMask to change the notify mask during the course of the voice session.