DirectX:DirectPlay:Tutorials:VB:DX7:Enumeration
From GDWiki
| The source code or techniques discussed in this article may be deprecated. Please see Network for a better solution. |
Resistance is futile; you will be enumerated!
Oops, are my dork genes showing? Anyhoo, what we're here to do is create a list of the available service providers so that we can present the user with some choices. As stated in the introduction, we'll most likely find four providers (the fab four): IPX, Serial, Modem, and TCP/IP. To obtain information on the available service providers, we must first fill a DirectPlayEnumConnections object with data:
Dim objEnumConnections As DirectPlayEnumConnections Set objEnumConnections = dp.GetDPEnumConnections("", DPCONNECTION_DIRECTPLAY)
We can then determine the total number of available providers by calling the GetCount method.
Dim lngNumConnections As Long lngNumConnections = objEnumConnections.GetCount
Next, we loop through each service provider and extract its name so that we may present it to the user. In this case, we'll populate a list box as we go along.
Dim LstBox as ListBox For i = 1 To lngNumConnections LstBox.AddItem objEnumConnections.GetName(i) Next
Are we having fun yet?
Keep on truckin! Read the Initializing a Connection tutorial. (Click here to download this tutorial's source code.)

