Platform SDK: DirectX

Step 1: Register the Application

In order for the application to be visible to the lobby client, it must be registered. You can register a lobbyable application by using the DirectXRegisterApplication C/C++ function in DirectSetup, or you can supply your own registration utility that uses the DirectPlayLobby3.RegisterApplication method. The following sample procedure registers DXVBChat.exe, which must be in the same folder as the registration application:

Dim dx As New DirectX7
Dim dpl As DirectPlayLobby3
Const AppGuid = "{EB5E7E20-0303-11d3-9AAB-00104BCC1EAA}"
 
Private Sub RegisterApp()
 
  Dim dpappdesc As DPAPPLICATIONDESC2
  Dim dpl as DirectPlayLobby3
 
  With dpappdesc
    .strApplicationName = "DXVBChat"
    .strCommandLine = ""
    .strCurrentDirectory = App.Path
    .strDescription = "Chat (DirectX for Visual Basic)"
    .strFilename = "DXVBChat.exe"
    .strGuid = AppGuid
    .strPath = App.Path
  End With
 
  On Local Error GoTo ERRORS
 
  Set dpl = dx.DirectPlayLobbyCreate
  Call dpl.RegisterApplication(dpappdesc)
  Exit Sub
 
ERRORS:
  MsgBox "Failed to register application."
  Unload Me
 
End Sub

The following procedure unregisters the same application:

Private Sub UnregisterApp()

  On Local Error GoTo FAILED
  Call dpl.UnregisterApplication(AppGuid)
  MsgBox "Unregistration successful."
  Exit Sub
 
FAILED:
  If Err.Number = DPERR_UNKNOWNAPPLICATION Then
    MsgBox "Application not registered."
  End If
  Unload Me
 
End Sub

Next: Step 2: Get Connection Settings