Post 18 Mar 2009, 13:52 by MrcredsAlex
Fixed a bit of that C++ code and ported it to C#, but it now has Microsoft.DirectX.DirectPlay.DoesNotExistException
- Code:
Microsoft.DirectX.DirectPlay.Lobby.Client connection = new Microsoft.DirectX.DirectPlay.Lobby.Client();
      ConnectInformation ci = new ConnectInformation();
      ci.GuidApplication = new Guid("{65bebb82-ae34-46e2-b89c-18dd09826ff8}");
      ci.Flags = Microsoft.DirectX.DirectPlay.Lobby.ConnectFlags.LaunchNew;
      ci.UseConnectionSettings = true;
      Address address = new Address();
      address.AddComponent(Address.KeyHostname, "localhost");
      address.AddComponent(Address.KeyPort, 2300);
      address.Device=Address.ServiceProviderTcpIp;
      address.ServiceProvider=Address.ServiceProviderTcpIp;
      ci.ConnectionSettings.SetDeviceAddresses(new Address[]{address});
      ci.ConnectionSettings.PlayerName = "MeTheHost";
      ci.ConnectionSettings.HostAddress=new Address("localhost",7575);
      int kamh = connection.ConnectApplication(ci,System.Threading.Timeout.Infinite,null);[/quote]