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.

Create console window for debugging from gauge

Featured Replies

  • Commercial Member

Hi,I have come across a very annoying problem with one of my gauges: it works fine when I run the gauge in VS2008-debug mode, but it generates errors when I compile in "release" mode.The problem most likely is related to a memory allocation problem with a pointer or array.It would make my life a lot easier if I could open a console window from my gauge to write some variable values to, so I can see what is happening inside the gauge exactly!Has anyone been able to do this and would you share this knowledge ?Thanks,Bj

simcheck_sig_banner_devteam.jpg

 

Bj

  • Moderator

The simplest approach would be to use a Message Box:

// declare these in your gaugename.h file:HRESULT ErrorHr;		// holds the Hresult #define FS2_ERROR_CALLBACK_MESSAGE_LENGTH_MAX	1024TCHAR messagetext[FS2_ERROR_CALLBACK_MESSAGE_LENGTH_MAX]; // will hold error Message// Add the MessageBox wherever you need it in your gauge code:else if (ErrorOccured == 1){	ErrorOccured = 0;	StopWorking = 1;	_stprintf(messagetext, _T("This Module will only work with Licensed Lionheart Creations Aircraft."), ErrorHr); 	MessageBox(NULL, messagetext,	_T("FBDS License Invalid."), MB_OK);}

You can easily pass anything to a MessageBox.As an aside, you may well simply be missing some required dependencies from your Release compile. Use DependencyWalker to see what -if anything- is missing...

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
  • Commercial Member

The majority of errors that show up only in 'Release' compiles are indeed related to memory allocation... however, bad indexing into data arrays can also cause it. The 'Debug' compile runs inside a protected space and thus doesn't crash under many conditions the 'Release' compile will.

Ed Wilson

Mindstar Aviation
My Playland - I69

  • Author
  • Commercial Member

Hi guys,I tried the messagebox approach earlier on and it is simple and works but.... not very handy if you want to show a lot of data and do many checks and it really breaks the flow of things.I ended up creating a log file using the code I found here:http://www.infernodevelopment.com/c-log-fi...orget-debuggersVery easy to implement and works very nicely.Bug isn't solved yet but at least I have a good instrument now to find it...Thanks,Bj

simcheck_sig_banner_devteam.jpg

 

Bj

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.