Platform SDK: DirectX

Step 1: Create the DirectPlay Object

[Visual Basic]

This tutorial pertains only to applications written in C++. See DirectPlay Visual Basic Tutorials.

[C++]

Before any methods can be called, the application must obtain an interface to a DirectPlay object.

The following example shows how to obtain the IDirectPlay4 interface:

if ( FAILED( hr = CoCreateInstance( CLSID_DirectPlay, NULL, 
        CLSCTX_ALL, IID_IDirectPlay4A, (VOID**)&g_pDP ) ) )
    return hr;

Next: Step 2: Enumerate and Initialize the Service Providers