Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

gauges.h outside of cgauge

Featured Replies

HiI'm trying to figure out how to use the gauges.h functions outside of a cgauge. I've been looking at the cabincomfort.dll as an example. I can get my program to compile but it crashes at runtime. Here is the outline of my .exe program:// application.cpp#include "GAUGES.H"PPANELS Panels = NULL;GAUGESIMPORT ImportTable = { 0x0000000F, (PPANELS)NULL }, { 0x00000000, NULL } }; void FSAPI module_init(void){ if (NULL != Panels) { ImportTable.PANELSentry.fnptr = (PPANELS)Panels; }} void FSAPI module_deinit(void){}// This is the module's export table.GAUGESLINKAGE Linkage = { 0x00000013, module_init, module_deinit, 0, 0, FS9LINK_VERSION, { 0 }};int main(){ check_named_variable("my_named_variable");}//////////////////////////////////////////////////////////////////////////////This code will at least compile, but crashes at runtime. When I get to check_named_variable(), I get an access error.I basically just copied everything before main() from the cabincomfort.cpp. if I comment out all the definitions before main() I get this error: unresolved external symbol _ImportTableCan anybody tell me what I'm missing here?Thanks

But I can call the check_named_variable() from the cabincomfort.cpp and it works. Is it because that is a dll and I'm trying to do it from a .exe?

  • Moderator

>But I can call the check_named_variable() from the>cabincomfort.cpp and it works. Is it because that is a dll>and I'm trying to do it from a .exe?In a word, yes. A .dll is loaded by the sim and still runs "in process" unlike an external app running as an .exe "out of process."You will need to use FSX SimConnect if you wish to interface an .exe and the sim.

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Thanks Bill I'm trying to read/write to a user defined gauge variable from outside the gauge itself. So it looks like I can do this using the gauge functions only from within a dll. I was hoping to be able to do this from an exe too. I tried something like this:SimConnect_AddToDataDefinition(hSimConnect, DEFINITION__NUMBER,"my_number", "int"); my_number being a gauge variable I defined. I get a simconnect exception 'name_unrecognized' by doing this. So my question is, is there any way to write directly to a user defined gauge variable from an exe? Thanks againBobby

  • Author
  • Commercial Member

SimConnect only understands FS variables. User defined variables are not part of FS.There is another forum for SimConnect discussions, because SimConnect is not normally used inside a gauge.

Ed Wilson

Mindstar Aviation
My Playland - I69

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.