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

rhumbaflappy

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

Ken Adam, Scott Hendry, and Jacky Brouze have finished a mountain of work in making SimConnect viable for Delphi programmers.

They have converted the headers and made many examples for both console and form-based applications, based on the SDK examples. It can be found here:

http://home.exetel.com.au/flightsim/SimConnectDelphi.htm

A wonderful, cooperative effort to give this freely to the community.

Borland makes Delphi Turbo Explorer ( for Win32 applications ) available for free:

http://www.turboexplorer.com/downloads


Dick
 
Thanks for the info, Dick. :)

I think I'm a bit stupid, though. :o
Ok, I never was a coder and I never will be, but how do I get the package to work with Delphi?
I just want to do one little thing: Create a small exe (or dll) that calls a FLT-file if it receives a call from simconnect.
I would really appreciate any help how to achieve this. :)
 
Sorry for the thread necromancy. Hope it is ok.

I'm just playing around with D2009 and the Delphi FSX SDK port from http://home.exetel.com.au/flightsim/SimConnectDelphi.htm.

No matter what I try I always get SIMCONNECT_RECV_ID_EXCEPTION with SIMCONNECT_EXCEPTION_NAME_UNRECOGNIZED (Index (Parameter) = 2).

In this example the "RequestData" sample.
Code:
hr := SimConnect_AddToDataDefinition(hSimConnect, Ord(DEFINITION1), 'Title',
      '', SIMCONNECT_DATATYPE_STRING256);
hr := SimConnect_AddToDataDefinition(hSimConnect, Ord(DEFINITION1),
      'Kohlsman setting hg', 'inHg');
...

The same sample for C++ works fine (same computer, same SimConnect.dll, same FSX).

Anyone any idea why the exceptions and how to fix it?
 
You may need to contact Scott. His email is in the readme file of the Download.

Unfortunately, I don't program in Delphi since C# came along. My involvement was simply to prove that it could be done, and get the process of conversion started. I don't even have Delphi currently on my computer, and I'm not to be considered fluent in it's usage.

Sorry.

Dick
 
Last edited:
Alright. Thanks for the reply. I'll try it.

Between my idea was to code a dummy DLL in C++ which exports some of the functions SimConnect.dll has, like SimConnect_AddToDataDefinition to see what he receives on the other side. Maybe it is just a pointer problem.
 
I reinstalled Turbo Delphi 2006, and it compiled the RequestData example just fine. On running, it behaved as expected.

Edited++++++++++++

I mis-spoke. I tried the windows form version and it worked fine. The console version did not.

Dick
 
Last edited:
Thanks for the test. You confirm it works with Turbo Delphi? Strange ... Tested it with Delphi 6 Prof and Delphi 2009. Compilation and starting worked fine. But clicking "Start Poll" or "Start Event" returns "Receive Id: 1" to the Callback which means SIMCONNECT_RECV_ID_EXCEPTION, as already described.

I'll just try Turbo Delphi too.

** Edit **

Indeed, just tried it with Turbo Delphi and it works. :scratchch

I think thats OK for me also.
 
Last edited:
The bad thing is the console examples don't work for me. They return a "2" error, which is a type mismatch. I don't know why the windows version would work, and the console would not.

Perhaps ther is some compilation dirtective that is causing the error. The simconnect.pas is the same, and that should control the exchange of values between simconnect and the program.

Dick
 
Last edited:
I think I found my solution.

The console examples need to have the HeaderStandard version of Simconnect.pas referenced, at least as they are written.

Dick
 
SimConnect and Delphi 2009 (or 2010)

SimConnect.pas (HeaderRT) worked fine with Delphi 2007. With Delphi 2010 I suddenly got the "unrecognized name" exception. The following changes in the SimConnect.pas file resolved the problem:
1. Replace every instance of the text "of Char" with " of AnsiChar"
2. In the function declaration of SimConnect_AddToDataDefinition change
"DatumName: string" to "DatumName: AnsiString" and
"UnitsName: string" to "UnitsName: AnsiString"
(3. In the RequestData sample and other applications also change
"title: packed array[0..255] of Char"; into
"title: packed array[0..255] of AnsiChar";)
 
I would love to get a copy of that Chas. Unfortunately, the original website seems to be down. :(

Skysimflight.cc isn't loading either.

g.
 
Back
Top