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

FSX Problems in SDK Gauges sample [newbie]

Messages
18
Country
italy
Hi to all,

I'm completely newbie in FSX programming. I'm trying to complete the tutorial showed at https://msdn.microsoft.com/en-us/library/cc526958.aspx. My setup is the following:
  1. FSX SDK v. sp1a
  2. Microsoft Visual Studio 2015 community edition
I correctly compiled the code in C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X SDK\SDK\SimObject Creation Kit\Panels and Gauges SDK\sample, obtaining SDK.dll.

Next, I followed the step in C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X SDK\SDK\SimObject Creation Kit\Panels and Gauges SDK\sample\README.txt. I repeat here for the sake of completeness:

Copyright (c) 2006 Microsoft Corporation. All rights reserved.

This is a sample of several Flight Simulator X code gauges. You can compile the sample and use the gauges in the game.

The SDKSample.VCPROJ is a Microsoft Visual Studio 2005 project file set up to build the gauge "SDK.dll" using the .cpp source files that are part of this sample. This project file can be opened with either Microsoft Visual Studio 2005 or Microsoft Visual Studio Express. Microsoft Visual Studio Express is a free product available for download at http://msdn.microsoft.com/vstudio/express/visualc/.

Instructions:

- Open the SDKSample.vcproj Visual Studio Project file
- Examine the cpp source files, the .h header files, and the makefile. Reference the SDK documentation to understand how these files are written
- Select Build->Build SDKSample, and observe the Output window results
- You should now have a file called SDK.dll in the directory from which you are running the VCProj file.
- Copy the SDK.dll file to the "\Program Files\Microsoft Games\Micorsoft Flight Simulator X\gauges" directory. (Note that this directory may be different if you didn't not install Flight Simulator to its default installation location).
- Now edit the aircraft.cfg for an aircraft (we recommend the Cessna 172) to add a new variation which will use the SDK panel. Open FSX\SimObjects\Airplanes\C172\aircraft.cfg and add the following lines after the [fltsim.5] section:

[fltsim.6]
title=Cessna Skyhawk 172SP SDK panel
sim=Cessna172SP
model=
panel=SDK
sound=
texture=
kb_checklists=Cessna172SP_check
kb_reference=Cessna172SP_ref
atc_id=N760PL
ui_manufacturer="Cessna"
ui_type="C172SP Skyhawk SDK"
ui_variation=" SDK"
ui_typerole="Single Engine Prop"
ui_createdby="Microsoft Corporation"

- Create a new directory called "Panel.SDK" in the FSX\SimObjects\Airplanes\C172 directory. Copy the panel.cfg and Cessna_panel_1024.bmp to this directory.
- Run FSX, select "Free Flight", "Change aircraft" and select the .

You'll notice that the gauges created with this SDK are of lower visual quality than those shipped with the product. This is due to the lower resolution textures in the \res directory of this sample. Higher quality images can be used for any gauges you create yourself.

At the end of this process, I open FSX and load "C172SP Skyhawk SDK". With great disappointment, that is what I see:



No gauge is inserted in the panel, that remains with this horrible holes!

Please note that all the gauge images exist C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\SimObjects\Airplanes\C172\Panel.SDK.

Any help is appreciated!

Mauro
 

Heretic

Resource contributor
Messages
6,828
Country
germany
a) Version SP1a of the SDK is outdated. Either use the one for SP2 or Acceleration, depending on FSX versiuon installed.
b) The panel= line of each of the C172's [fltsim.x] entries (in its aircraft.cfg) needs to point to the panel.sdk folder (panel=SDK).

I don't know anything abiout C++ gauges, so that's all I can contribute.
 
Messages
18
Country
italy
a) Version SP1a of the SDK is outdated. Either use the one for SP2 or Acceleration, depending on FSX versiuon installed.
b) The panel= line of each of the C172's [fltsim.x] entries (in its aircraft.cfg) needs to point to the panel.sdk folder (panel=SDK).

I don't know anything abiout C++ gauges, so that's all I can contribute.

Thanks for your answer,

unfortunately it didn't help because I already followed the steps you suggested.

I'm still stuck with this problem. I wonder if anyone else can help me...

Thanks anyway,
Mauro
 
Messages
697
Country
australia
The view appears to be a virtual cockpit.

The SDK example (at least in the SP2 one I have) shows the SDK.dll gauges only being used in a 2D panel.

What happens when you open the main panel?

I'd be trying to get a 2D gauge showing up first before worrying about the virtual cockpit as that way you only need to debug one thing (and not the texture mapping in the VC).

Is your panel.cfg like this one which is the example given in the SDK?

Code:
// SDK Panel Configuration file
// Sample panel layout to test behavior of SDK Code Gauges
// Copyright (c) 2006 Microsoft Corporation.  All rights reserved.
//
// Drop this file and the two bmp's into an aircraft's panel directory to test!

[Window Titles]
Window00=Main Panel
Window01=FlightMap


[Window00]
file_1024=Cessna_Panel_1024_Blank.bmp
size_mm=640
position=7
visible=1
ident=MAIN_PANEL

gauge00=SDK!Attitude,250,90
gauge01=SDK!Temperature,520,90
gauge02=SDK!Fuel,400,90
gauge03=SDK!Whiskey,100,90
gauge04=SDK!Fuel_Selector,10,90,50
gauge05=SDK!Control_Surfaces,300,250

[Window01]
size_mm=276,312
position=2
visible=1
ident=130

gauge00=SDK!FlightMap,0,0

[Default View]
X=0
Y=0
SIZE_X=8192
SIZE_Y=2500

The SDK.dll will also need to be in the aircrafts panel directory or the main FSX gauges directory.
 
Top