1 | // Helper function - Creates the DirectPlay object |
2 | static HRESULT CreateDirectPlayInterface() |
3 | { |
4 | HRESULT hr; |
5 | // Retrieve a DirectPlay 1.0 interface. |
6 | hr = DirectPlayCreate(lpServiceProviderGuid, &lpDirectPlay1, NULL); |
7 | if FAILED(hr) |
8 | { |
9 | if (lpDirectPlay1) |
10 | lpDirectPlay1->Release(); |
11 | ::MessageBox(NULL,"DirectPlayCreate Failed", "HelloWorld", MB_OK); |
12 | } |
13 | delete lpServiceProviderGuid; |
14 | return (hr); |
15 | } |
16 | CreateDirectPlayInterface(): |
17 | Actually creates the DirectPlay object |
18 | Once we create the DirectPlay |
19 | object, we no longer need the |
20 | service providers GUID |