Basic HTML version of Foils prepared July 5 98

Foil 161 PPT Slide

From FMS: Forces Modeling and Simulation Handout JSU HPC Summer Institute for Undergraduates, Jackson MS -- June 15 1998. by Wojtek Furmanski, Subhash Nair, Tom Pulikal


//Look for a Hello World Session which might be already running
static HRESULT FindSession()
{
HRESULT hr;
DPSESSIONDESC sessionDesc;
ZeroMemory(&sessionDesc, sizeof(DPSESSIONDESC));
sessionDesc.dwSize = sizeof(DPSESSIONDESC);
sessionDesc.guidSession = sessionGUID;
hr = lpDirectPlay1->EnumSessions(&sessionDesc, 1000, EnumSessionsCallback,
hwndApp, DPENUMSESSIONS_AVAILABLE);
if FAILED(hr)
::MessageBox(NULL,"Could not find any HelloWorld sessions", "HelloWorld", MB_OK);
return(hr);
}
// Callback function for enumerating sessions
static BOOL FAR PASCAL EnumSessionsCallback(
LPDPSESSIONDESC lpSessionDesc,
LPVOID lpContext,
LPDWORD lpdwTimeOut,
DWORD dwFlags
)
{
if (dwFlags & DPESC_TIMEDOUT)
::MessageBox(NULL,"Could not find a HelloWorld session!....Timed Out", "HelloWorld", MB_OK);
else
::MessageBox(NULL,"Found a HelloWorld session!", "HelloWorld", MB_OK);
return(FALSE);
}
FindSession():
Enumerates other DirectPlay
sessions with same GUID
EnumSessionsCallback()
is called by DirectPlay for each session it finds.



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sat Nov 28 1998