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

Delphi and SimConnect

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
6,644
Country
us-wisconsin
Hi all.

I have a conversion of the SimConnect.h file that seems to work with Delphi.

I've used it with Delphi7 and the new win32 Turbo Delphi Explorer ( FREE ):

http://www.turboexplorer.com/mirror

(Note: you cannot have both Turbo Delphi Explorer and Turbo C++ Explorer installed at the same time... use one or the other.)

A test file that includes all the needed support files here:

http://webpages.charter.net/ludowr/DelphiOpenClose.zip

Included in the zip is a MANIFEST file, a RES file and an RC file, along with SimConnect_4.pas ( the H file conversion ).

The above four files must be in the project's base folder so the compiler can find them. OpenClose.dpr is the actual program. The code is pretty simple.

The compiled OpenClose.exe is a native win32 file that will find the SimConnect.dll on your computer... so it is truly "stand-alone". No further playing around with the manifest file, etc... :) It needs no runtime libraries, no .NET, and can be placed anywhere on your computer.

What OpenClose.exe does is simply open a connection to FSX via SimConnect, and then close it. It's a command-line program, so run it from a command window ( CMD.exe ).

SimConnect_4.pas is my 4th attempt to get this thing working... I'm sure it has errors, but we have a start. If anyone else can improve it, feel free to post it here for testing! Hopefully within a month or two, we'll have a solid version.

So, we now have SimConnect working in the Delphi environment... lots of fun for RAD Windows form developers, and programmers that like Delphi.

Dick
 
This is a copy of my post on avsim forum, I think I would better to post here ...

Hello Dick,

Merry Christmas !

This message is NOT a Christmas gift :D just an assistance call ...

I am trying to change your DelphiOpenClose small program in order to make it display the current aircraft position.

Reading the SDK and looking at your SimConnect_4 source, I am not able to achieve my goals.

1) SimConnect_AddToDataDefinition

The SDK gives an example :
hr = SimConnect_AddToDataDefinition(
hSimConnect,
DEFINITION_1,
"Kohlsman setting hg",
"inHg");

But your SimConnect_4 file says :
SimConnect_AddToDataDefinition(
hSimConnect:longint;
DefineID: longint;
DatumName: string;
UnitsName: string;
var DatumType: longint;
var fEpsilon: single;
var DatumID: longint):

What should I give as fEpsilon and DatumID ?

2) In order to get my results in my own dispatch proc, I believe that I should call SimConnect_CallDispatch . But I can^t find this procedure in your SimConnect_4 file.

Could you please give me a kick :eek: ?

Thanks in advance for your help. :)

Jacky
 
Hi All.

The "OpenClose" zip above has been revamped using SimConnect_5.pas:

http://webpages.charter.net/ludowr/DelphiOpenClose.zip

Re-download if you've already used it.

All 68 functions are fleshed out, but they are not all tested and WILL need alterations.

( Jacky... check it out, and see if you can get what you want from this. )

Dick
 
simconnect - reply to thread

what would the vb code be to connect to the simulator?

as i want to able to show where my aircraft is situated

question for those in know.

how does one implement the graphic respresentation of elements
like helipads, runways etc, is this all coded ? and could i use images
or vb shapes to do this for things like displaying a taxiway, etc

Gareth
Vads
Virtual Aerospace Design SA
 
Back
Top