• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

VB.NET examples on connection

Messages
49
Hey guys!!
I am new to SimConnect and I was reading through the SimConnect client documentation.
I got to install SimConnect client perfectly and I created a new VB.net project.
Basically I want to test the connection to SimConnect server and disconnect. From there I will start making tests with different functions but for some reason I don't find the code to actually do a
Simconnect.Open() or something like that.
How would I open a connection to an existing SimConnect server on the same machine?
Sorry for my dumb question but I want to learn how to interact with FSX.
Thanks much in advance,
Teo
 
Hi Teofilo,

Somewhere in your code, you have a variable declaration like this:

Dim sc as Microsoft.FlightSimulator.SimConnect.SimConnect;​

and then in your startup/connect code, you have a line like this:

sc = New Microsoft.FlightSimulator.SimConnect.SimConnect("client title", Me.Handle, WM_USER_SIMCONNECT, Nothing, 0)​

That line, when creating the SimConnect object, also does the SimConnect_Open call, so you don't need to do an open - if the New call worked, you have a connection to the Sim.

Here's a link to a VB sample app. That's about the extent of my knowledge of VB.Net though :->
 
Hi!!

Thanks much for your help. I looked at the documentation enclosed in the SimConnect folder and saw a VB.NET example so I was able to connect (after trying to understand some of the code).
Its a bit complex to get to connect. I had to specify a constant for example:
' User-defined win32 event
Private Const WM_USER_SIMCONNECT As Integer = &H402
Some of it I don't understand why you need to create a win32 event.

Regards,
Teo
 
hi guys.

how do i actually get vs2008 to expose the flightsimulator namespace when i try to import Microsoft.FlightSimulator.SimConnect? I've installed the sdk, and simconnect but it won't work. what else do i need to do? :confused:
 
i got it...

hi guys.

how do i actually get vs2008 to expose the flightsimulator namespace when i try to import Microsoft.FlightSimulator.SimConnect? I've installed the sdk, and simconnect but it won't work. what else do i need to do? :confused:

I understand now...I realised I have to add the reference.
 
Back
Top