Original Post
Hi,
I''ve got a problem with IDirectPlay8Client::SetClientInfo. I have the following code snippet:
WCHAR temp[MAX_PATH];
mbstowcs(temp,"PlayerName",MAX_PATH);
DPN_PLAYER_INFO playerInfo;
ZeroMemory(&playerInfo, sizeof(DPN_PLAYER_INFO));
playerInfo.dwSize = sizeof(DPN_PLAYER_INFO);
playerInfo.pwszName = temp;
playerInfo.dwInfoFlags = DPNINFO_NAME;
playerInfo.dwDataSize = 0;
playerInfo.pvData = NULL;
playerInfo.dwPlayerFlags = DPNPLAYER_LOCAL;
DPNHANDLE tempHandle=NULL;
if (FAILED(g_pDPClient->SetClientInfo(&playerInfo, NULL, &tempHandle, DPNSETCLIENTINFO_SYNC)))
{
switch(hr)
{
case (DPNERR_NOCONNECTION):
{
Failed("DPNERR_NOCONNECTION");
break;
}
case (DPNERR_INVALIDFLAGS):
{
Failed("DPNERR_INVALIDFLAGS");
break;
}
case (DPNERR_INVALIDPARAM):
{
Failed("DPNERR_INVALIDPARAM");
break;
}
case (DPNERR_PENDING):
{
Failed("DPNERR_PENDING");
break;
}
default:
{
// This one fires
Failed(NULL);
break;
}
}
}
The call to SetClientInfo fails, but I don''t get one of the possible error codes noted in the DX8 docs.
What might be the problem here? I call SetClientInfo right before Connect, and everything else works fine. Any help is greatly appreciated.