Advertisement

DirectPlay8, client program, get IP address

Started by November 22, 2005 03:50 AM
2 comments, last by BigBeginner 19 years, 3 months ago
Greetings mortals, I'm programming on a communication program. The server creating is OK, I want to enumerate the available hosts. I found a server, and get it's IDirectPlay8Address class. I heard that the "GetComponentByName" function is useless to get the physics IP, so I have tried to use the QueryInterface method, like this: pAddressSender.QueryInterface(CLSID_DirectPlay8Address, IP); The IP parameter is IDirectPlay8AddressIP. But it returns with message: "The interface is not supported". When I create the server, I set up it's provider, and port. A IP didn't, because I think I can't override the available IP. The program runs on LAN. Please don't prefer me to use winSock, because I don't want to throw out the extant. :-)
I'm getting near the sollution :)

Finally I could get the IPaddress interface. I ask for information with :GetAddress method. It returns with a CORRECT port number - and the host string only contain '1'.

o_O

What I'm goint to do?
Advertisement
I'm almost solved this!!

I get the address with this:

pAddressSender.GetComponentByName(DPNA_KEY_HOSTNAME, buff, SIZE,TIPE);

The BUFF contain the IP address, I guess. And how to convert it into a string???
Ok, I solved the problem. Thanx all help. It is good to speak myself. :S if anybody ask me how to did this, I will tell it :) Ok, I know I shouldn't use to DirectPlay, but as I mentioned it, I have almost written an working network-interface :)

This topic is closed to new replies.

Advertisement