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


1 //Look for a Hello World Session which might be already running
2 static HRESULT FindSession()
3 {
4 HRESULT hr;
5 DPSESSIONDESC sessionDesc;
6 ZeroMemory(&sessionDesc, sizeof(DPSESSIONDESC));
7 sessionDesc.dwSize = sizeof(DPSESSIONDESC);
8 sessionDesc.guidSession = sessionGUID;
9 hr = lpDirectPlay1->EnumSessions(&sessionDesc, 1000, EnumSessionsCallback,
10 hwndApp, DPENUMSESSIONS_AVAILABLE);
11 if FAILED(hr)
12 ::MessageBox(NULL,"Could not find any HelloWorld sessions", "HelloWorld", MB_OK);
13 return(hr);
14 }
15 // Callback function for enumerating sessions
16 static BOOL FAR PASCAL EnumSessionsCallback(
17 LPDPSESSIONDESC lpSessionDesc,
18 LPVOID lpContext,
19 LPDWORD lpdwTimeOut,
20 DWORD dwFlags
21 )
22 {
23 if (dwFlags & DPESC_TIMEDOUT)
24 ::MessageBox(NULL,"Could not find a HelloWorld session!....Timed Out", "HelloWorld", MB_OK);
25 else
26 ::MessageBox(NULL,"Found a HelloWorld session!", "HelloWorld", MB_OK);
27 return(FALSE);
28 }
29 FindSession():
30 Enumerates other DirectPlay
31 sessions with same GUID
32 EnumSessionsCallback()
33 is called by DirectPlay for each session it finds.

in Table To:


© 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