DirectPlay FAQ
Q: How can I get the IP address of the computer my program is running
on?
A: GetLocalHostAddress can be used to get the host name
and/or IP. GetLocalHostAddress returns a DirectPlay8Address object. You use the
DirectPlay8Address.GetComponentString method of this object, passing "hostname"
for the sComponent parameter, to return the host name string. Note: there could
be more than one IP on the system. See the following question for more details.
Q: DirecPlay8Peer.GetLocalHostAddress fails with error 5, invalid
procedure call or argument.
A: If your machine has more than one IP address (for
example a network card using TCP/IP and a modem using TCP/IP at the same time)
the method will fail. The method should really be called GetLocalHostAddresses
(plural) as it is in the C++ docs. This is an issue that should be resolved for
DX9. One alternative would be to create a simple Winsock class that could
enumerate the IPs for you.
Q: What is the DirectPlay8Peer.GetEnumHostResponseAddress function
used for?
A: It's a non-existent function that shouldn't be in the
docs.
Q: DPNSVR keeps running after my application closes.
A: DPNSVR stays around for up to 10 minutes in the event
another session is started. If you don't require host enumeration, DPNSVR can be
disabled by setting the DPNSESSION_NODPNSVR flag in your DPN_APPLICATION_DESC
type. You can also shut down DPNSVR by running DPNSVR /K from the command line.