Jump to content
  • Advertisement
Sign in to follow this  
BigBeginner

DirectPlay connect to a server error

This topic is 4847 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there, I'm working on a network program. The server creating and ennumerating is ok, but I'm trouble with connecting to a server. Here is the code (delphi, the C++ coders will understand it): const GGGG : TGUID = '{83783300-4063-4c8a-9DB3-82830A7FEB31}'; var TargetHost : IDirectPlay8Address; Host : pwchar; begin DirectPlay8AddressCreate (GGGG, TargetHost, nil); // THE "GGGG" CONTAIN THE GUID OF DIRECTPLAY8ADDRESS. Getmem (PORT, 4); PORT:= pwchar(Target.Port); Getmem (HOST, 255); FillChar (HOST^, 255, 0); StringToWideChar ('192.168.144.113', HOST, 253); TargetHost.SetSP(@CLSID_DP8SP_TCPIP); TargetHost.AddComponent(DPNA_KEY_PORT, @PORT, sizeof(DWORD), DPNA_DATATYPE_DWORD); TargetHost.AddComponent(DPNA_KEY_HOSTNAME, HOST, 255, DPNA_DATATYPE_STRING); end; And here, the "TargetHost.AddComponent(DPNA_KEY_HOSTNAME, HOST, 255, DPNA_DATATYPE_STRING);" sends back an error message: 'One or more of the parameters passed to the method are invalid.' What can I do? I visit Micro$oft MSDN, and some codes, everyone connect to the server like this. This is an server/client architect. The address doesn't want to accept the host adding.

Share this post


Link to post
Share on other sites
Advertisement
My advice would be switch to sockets. DirectPlay is basically obsolete, or will be by the time your app is complete :)

There are many online resources for winsocks, if your running windows?

I switched, and haven't looked back!

Good Luck!

Si

Share this post


Link to post
Share on other sites
Yes, if the hell freezes, I will. The error can be the host name, but I don't know what about it... I get some memory for it, convert an IP address to unicode. I think DP doesn't like my host name, but why? I saw some C code, and all do it like this.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!