   directplay connect to session help...
  hey everybody, I''m new to game develop, right now I''m working on my Network componnent, and I run in this trouble, I can setup a host, but I can''t setup the connection to that host session, here is portion of my code, could anyone look at it and give me some suggestion where I went wrong. The error code that I receive it the FAILED(hr), not the DPNERR_ADDRESSING. Oh, this is my testing console project..HRESULT connectSession(){ // for connect to the session   HRESULT hr;   DPN_APPLICATION_DESC  dpnAppDesc   = {0};    TCHAR tmpIp[MAX_PATH];   IDirectPlay8Address* pHostAddress= NULL;   IDirectPlay8Address* pDeviceAddress   = NULL;   hr = CoCreateInstance(CLSID_DirectPlay8Address, NULL,  CLSCTX_INPROC_SERVER, IID_IDirectPlay8Address,(LPVOID*) &pDeviceAddress);   hr = CoCreateInstance( CLSID_DirectPlay8Address,NULL,   CLSCTX_INPROC_SERVER,   IID_IDirectPlay8Address,   (LPVOID*) &pHostAddress );   hr = pDeviceAddress->SetSP(&CLSID_DP8SP_TCPIP );    if(FAILED(hr)){cout << "setup device provider wrong\n";}   hr = pHostAddress->SetSP(&CLSID_DP8SP_TCPIP );   if(FAILED(hr)){cout << "setup host provider wrong\n";   }//pDeviceAddress->SetDeviceDPN_PLAYER_INFO dpPlayerInfo;    ZeroMemory( &dpPlayerInfo, sizeof(DPN_PLAYER_INFO) );    dpPlayerInfo.dwSize  = sizeof(DPN_PLAYER_INFO);    dpPlayerInfo.dwInfoFlags  = DPNINFO_NAME;    dpPlayerInfo.pwszName= NULL;hr = peer->SetPeerInfo( &dpPlayerInfo, NULL, NULL, DPNOP_SYNC );if(FAILED(hr)){cout << "can''t set peer info on connect\n";}ZeroMemory(&dpnAppDesc, sizeof(DPN_APPLICATION_DESC));    dpnAppDesc.dwSize = sizeof(DPN_APPLICATION_DESC);    dpnAppDesc.guidApplication = g_guidApp;    WCHAR wstrHostname[MAX_PATH];    DWORD wport = 9053;    DXUtil_ConvertAnsiStringToGenericCch( tmpIp, Ip.c_str(), MAX_PATH );DXUtil_ConvertGenericStringToWideCch( wstrHostname,   tmpIp,MAX_PATH);  pHostAddress->AddComponent(DPNA_KEY_HOSTNAME, wstrHostname,   (DWORD) (wcslen(wstrHostname)+1)*sizeof(WCHAR),DPNA_DATATYPE_STRING);pHostAddress->AddComponent( DPNA_KEY_PORT,&wport, sizeof   (wport),DPNA_DATATYPE_DWORD );  hr = peer->Connect(&dpnAppDesc,pHostAddress,    pDeviceAddress,NULL, NULL,NULL, 0, NULL,NULL, NULL,DPNCONNECT_SYNC);  if(hr == DPNERR_ADDRESSING){cout << "wrong somewhere in the addressing\n";}if(FAILED(hr)){cout << "connect fail\n";}else{SAFE_RELEASE(pHostAddress);SAFE_RELEASE(pDeviceAddress);}return hr;} 