• 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.

SimConnect with Visual Basic 2005

Messages
1
Country
canada
Hey all,
I have been trying to figure out how to use FSX SimConnect with Visual basic 2005 (.Net) with not much success.
I would appreciate it greatly if anyone would show me how to go about doing that, or maybe point me to a site were I can follow some examples in visual basic. I have found a number of sites that deal with C# but I am not familiar with the language.
When I open VS 2005, do I need to somehow point to SimConnect to access its functions or something?
Thank you
Joe
 
It worked for me. Start with the "Managed VB Data Request" sample. The documentation in the SDK is not explicit on VB in particular and you have to translate the usual C-form of the statements in the docs from:

hr = SimConnect_RequestDataOnSimObjectType(hSimConnect, REQUEST_1, DEFINITION_1, 0, SIMCONNECT_SIMOBJECT_TYPE_USER);

into something like this:

fsx_simconnect.RequestDataOnSimObjectType(DataRequests.Request_1, StructDefinitions.Struct1, 0, _ Microsoft.FlightSimulator.SimConnect.SIMCONNECT_SIMOBJECT_TYPE.USER)

(the _ indicates the continuation in the next line)
best regards,
Peter
 
Maybe this will help

While this is C# code, it does go thru the basics of getting started, which I would imagine is the same. It shows you how to include the simconnect.dll file.

There are currently 4 tutorials that walk you through an example. I found it to be helpful when I was starting out.

http://www.notasenator.com/blog/

Hope this helps.
 
Also looking for some vb.net help.

Hello,

This is my first post in this forum. I've abused the search engine looking for vb.net examples to help me, but haven't found what i'm looking for. I also have a hard time with the c# language. I have made the c# examples work from the simconnect docs, but i can't seem to translate them well enough to get them working in VB.NET.

Are there any working VB.NET projects i can get ahold of from anyone to get a running start at this?

Thanks!
 
If you have the SP1A version of the SDK, I think it had a couple of the C# examples translated to VB.Net included in it.
 
Thanks Beatle,

I was actually able to get those VB.Net Examples from SP1 working.

My goal was to simply cycle the gear. It took me a long time, but i was able to hack through it.

Here is my VS2005 project if it helps anyone: http://www.grayboot.com/temp/VB.NET_CycleGear.zip

Any feed back or critisizm is greatly appreciated.

-carthorse
 
Last edited:
Hello.. I am in the middle of a project written with VB 2005 Express.
To Date these are my accomplishments....
- connects to FSX
- can start/stop engine fires (converted from examples on this thread - Thanks to the author)
-Can read flaps and pitot input (converted from examples elswhere - thanks again to the authors)
-Button click displays lat, long, altitude, aircraft type, and (my own name as pilot lol) (converted from C# code - thank you authors)
-Clicking a button opens a second form with trackbars for aileron, elevator, throttle, rudder.

Dilemas...
Currently, the engine fires, Flaps, and Pitot heat work well however, the flaps and pitot heat are giving me double readings (printing twice to the notification window)

On the controls page, the ailerons, throttle, rudder and the elevator all work within half of their range. (example... Simconnect offsets for aileron axis is -16383 to +16383. If I use those values as minimum and maximum values in the trackbar on my form I receive a "Cannot divide by 0" error. If however, I use 0 as my minimum trackbar value, and 16383 as my maximum, I get aileron travel from centered to extreme left. Throttle, rudder and elevator work the same in that I only get down elevator travel /left rudder and throttle in a range of 50% to full.

Anyone have any ideas?

(parts of the code (controls page) has been uploaded in another post. [VB.Net Simconnect examples]

My purpose in writing the program is that eventually, I will program phidgets to mimic the button clicks and trackbar movements.

Thanks all.
 
Last edited:
Back
Top