Sign in to follow this  
Guest russell

DirectPlay and EnumHosts()

Recommended Posts

I'm trying to write a simple app to connect to Flight Simulator 2002,but EnumHosts() never finds the session I've created from within thegame.I've tried several of the sample apps in the DirectX 8 SDK, as well asa simple app created with the DirectX AppWizard for Visual C++. Here's the code from the AppWizard:

// GUID for FS2002:GUID g_guidApp = { 0x97C62470, 0x5F53, 0x4098, { 0xA8, 0xBB, 0x7F, 0x1F, 0x93, 0xB9, 0x4D, 0x93 } };[p][...][p]// Enumerate hostsDPN_APPLICATION_DESC dnAppDesc;ZeroMemory( &dnAppDesc, sizeof(DPN_APPLICATION_DESC) );dnAppDesc.dwSize = sizeof(DPN_APPLICATION_DESC);dnAppDesc.guidApplication = m_guidApp;[p]// Enumerate all the active DirectPlay games on the selected connectionhr = m_pDP->EnumHosts( &dnAppDesc,		// application description   m_pHostAddress,						// host address   m_pDeviceAddress,					  // device address   NULL,								  // pointer to user data   0,									 // user data size   INFINITE,							  // retry count (forever)   0,									 // retry interval   INFINITE,							  // time out (forever)   NULL,								  // user context   &m_hEnumAsyncOp,					   // async handle   DPNENUMHOSTS_OKTOQUERYFORADDRESSING	// flags   );

I never get a "DPN_MSGID_ENUM_HOSTS_RESPONSE" message back.I've also tried not setting the guid, and letting it search for anyavaiable guid, but that doesn't help. I've also tried sending NULLfor the host address, and letting it broadcast, but that doesn't helpeither.However, if I just compile the test app and run two copies of it, theycan find their own guid and connect to each other.Any ideas to help me get started here? Thanks for any clues...Russell

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this