Microsoft DirectX 9.0 SDK Update (Summer 2003) |
IDirectPlayVoiceServer::Initialize Method
Initializes the DirectPlayVoiceServer object by associating it with a Microsoft® DirectPlay® object. Additionally, this method registers a message handler with this interface.
Syntax
HRESULT Initialize(
LPUNKNOWN lpVoid, PDVMESSAGEHANDLER pMessageHandler, PVOID pUserContext, LPDWORD lpdwMessageMask, DWORD dwMessageMaskElements );
Parameters
- lpVoid
- [in] Pointer to the IUnknown interface for the DirectPlay object that this DirectPlayVoiceServer object should use.
- pMessageHandler
- [in] User-defined callback function that is called when there is a DirectPlayVoiceClient message to process. A thread within the DirectPlayVoiceClient object calls the callback function, so it is not 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 method is called.
- lpdwMessageMask
- [in] Array of DWORD values 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] DWORD value that specifies the number of elements in the lpdwMessageMask parameter. If lpdwMessageMask 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
You can call IDirectPlayVoiceServer::SetNotifyMask to change the notify mask during the course of the voice session.