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.
SetClientInfo
Hi,
I''ve got a problem with IDirectPlay8Client::SetClientInfo. I have the following code snippet:
Becasue you don''t assign hr anything?
//try thisif (FAILED(hr=g_pDPClient->SetClientInfo(&playerInfo, NULL, &tempHandle, DPNSETCLIENTINFO_SYNC)))
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
FYI, this helpful little utility function:
DXTRACE_ERR(_T("SetClientInfo"), hr);
DXTRACE_ERR(_T("SetClientInfo"), hr);
Mmmh... assigning a value to hr really makes a difference, doesn't it? *doh*
Well, although I now know more about the error (DPNERR_INVALIDFLAGS) I have to idea how to fix it. The flag I've used DPNSETCLIENTINFO_SYNC is the only one allowed by the function. I get the same error if I replace it by a plain 0.
I suppose the problem lies somewhere within the DPN_PLAYER_INFO structure ... Just where?
ADDENDUM: Ok, everything seems to work fine if I set playerInfo.dwPlayerFlags to 0... now I wonder: what is a host player? Isn't it the player created implicitly when a server starts a session? And what's a local player, if not a player playing on the server? Furthermore: How do I set up a local player, and under which circumstances might it be necessary to explicitly create a host player? I think the DX8 documentation is very vague on the whole DirectPlay8 component.
Thx in advance,
Arngrim
Edited by - Arngrim on November 23, 2000 9:07:25 AM
Well, although I now know more about the error (DPNERR_INVALIDFLAGS) I have to idea how to fix it. The flag I've used DPNSETCLIENTINFO_SYNC is the only one allowed by the function. I get the same error if I replace it by a plain 0.
I suppose the problem lies somewhere within the DPN_PLAYER_INFO structure ... Just where?
ADDENDUM: Ok, everything seems to work fine if I set playerInfo.dwPlayerFlags to 0... now I wonder: what is a host player? Isn't it the player created implicitly when a server starts a session? And what's a local player, if not a player playing on the server? Furthermore: How do I set up a local player, and under which circumstances might it be necessary to explicitly create a host player? I think the DX8 documentation is very vague on the whole DirectPlay8 component.
Thx in advance,
Arngrim
Edited by - Arngrim on November 23, 2000 9:07:25 AM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement