Microsoft DirectX 8.1 (C++)

IDirectPlayVoiceServer::Initialize

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

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 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 lpdwMessageMask parameter. If lpdwMessageMask 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 IDirectPlayVoiceServer::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.