473,804 Members | 3,855 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# DirectPlay lobby launch not working?

I am trying to launch Flight Simulator 2004, and have it connect to
localhost, I can do this in C++ but not on C#...

Here is my code:

ConnectInformat ion info = new ConnectInformat ion();
ConnectionSetti ngs settings = new ConnectionSetti ngs();
settings.HostAd dress = new Microsoft.Direc tX.DirectPlay.A ddress("127.0.0 .1",
23456);;
Guid g = new Guid("0808caa5-e62c-4691-8957-5d4524b922da");
info.Flags = ConnectFlags.La unchNew;
info.GuidApplic ation = g;
info.Connection Settings = settings;
info.UseConnect ionSettings = false;
connectioninfo = theClient.Conne ctApplication(i nfo, 60000, null);
theClient.SetCo nnectionSetting s(connectioninf o, settings);

if I change info.UseConnect ionSettings to true, the program crashes, if it's
false, the program is launched but does not connect to the multiplayer.

Any help will be approciated,
Moshe Bergman
Nov 15 '05 #1
1 2719
Moshe,

I'm also trying to interface to MSFS2004 using DirectX/Managed/C#. I've had
some luck by modifying the "Migrated Hosts" sample program under the
"Tutorials" directory.

The furthest I was able to get was to see the FS "Host" session returned
using "Peer.FindHost( )", and have it "Reject" my attempt to connect with
"Peer.Connect() ". Since I didn't format the data in the "Connect" packet,
I'm not surprised at the rejection.

Have you made any more progress on this?

"Moshe Bergman" <po**@newsgroup .com> wrote in message
news:ej******** *****@TK2MSFTNG P11.phx.gbl...
I am trying to launch Flight Simulator 2004, and have it connect to
localhost, I can do this in C++ but not on C#...

Here is my code:

ConnectInformat ion info = new ConnectInformat ion();
ConnectionSetti ngs settings = new ConnectionSetti ngs();
settings.HostAd dress = new Microsoft.Direc tX.DirectPlay.A ddress("127.0.0 .1", 23456);;
Guid g = new Guid("0808caa5-e62c-4691-8957-5d4524b922da");
info.Flags = ConnectFlags.La unchNew;
info.GuidApplic ation = g;
info.Connection Settings = settings;
info.UseConnect ionSettings = false;
connectioninfo = theClient.Conne ctApplication(i nfo, 60000, null);
theClient.SetCo nnectionSetting s(connectioninf o, settings);

if I change info.UseConnect ionSettings to true, the program crashes, if it's false, the program is launched but does not connect to the multiplayer.

Any help will be approciated,
Moshe Bergman

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3069
by: Lt | last post by:
Hello, I'm gonna write my first 3D multiplayer game using DirectPlay, VC++ ..NET 2002. I've done tutorials supplied along with DXSDK Then I wanted to use the DirectX AppWizard but it produced over 2300 lines of code! It's cool to have prepared automatically all initializations but it's a little too much. That's because I can't find any documentation on details HOW IT WORKS, how I can integrate my own game code with this framework. In...
4
1512
by: JariTapio | last post by:
Hei! I explored DirectX 8.1 SDK and found TUT09_ClientServer it includes the following code as a part of the tutorial... //---- HRESULT WINAPI DirectPlayMessageHandler(PVOID pvUserContext, DWORD dwMessageId, PVOID pMsgBuffer) {
3
1685
by: Mohammad-Reza | last post by:
Hi Please tell me how can I send a file with DirectPlay to a server.(Client/Server program). Thanks in advance
3
2743
by: Téo | last post by:
Hi, Do you know where i could find some interesting documentation about DirectPlay for managed dev. I have been searching for a long time on the web without any success. Thanks.
7
2743
by: Christopher C | last post by:
I am using a C# winform to launch some apps for our students. Basically the user hits a button the form hides and the app is launched. When the app exits, the form is unhidden. I have a question on two things. From what I understand since I am starting the program from the Process.Start it is on a separate thread and this is really not a problem. Secondly what is the best way to work this form. Do I dispose of the form when I start the app...
0
1033
by: saragwyn | last post by:
Hello - I have successfully been using the following line of code to launch the default browser from within my application. I recently got a report from one of my users that it wasn't working on their machine. They are using Win98 and said they had Firefox as their default browser then switched over to IE and it still didn't work. The qt_winTchar function turns a Qt library QString object into the correct pointer for this function.
4
3244
by: Chris Smith | last post by:
Experienced posters, Seems that the directx.networking newsgroup isn't very active, so forgive me for asking my question in this group. But anyone have any good example code or a good website for using DirectPlay 9 (DX9SDK) with vb.net. I have downloaded the sdk, and all the docs are for c#. Once again left out :( To give you some background on what I am trying to achieve. Create a
4
20916
by: Joe | last post by:
I created a CustomAction for this but I don't think I have it in the right place. I tried both Install and Commit but neither allow it to get to the final screen. Are there any examples of this anywhere? Thanks, Joe
18
2174
by: Prosdo | last post by:
Hey Everyone. I have a program for school that is suppose to project how many seconds it takes a projectile to hit the ground. I have the formula, but the loop is not posting to my output file. Can someone tell me what I'm doing wrong? #include <iostream.h> #include <stdlib.h> #include <cmath> #include <iomanip> #include <fstream> using namespace std; float const gravity = 9.8;
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9577
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10315
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10075
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9140
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7615
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6847
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.