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.

Resource elements in C++ gauge

Featured Replies

  • Commercial Member

I've taken the plunge to learn C++ gauge development. Note that I'm not new to C++; I'm just new Visual Studio and the way gauges are built.

 

Here's what's troubling me. I've downloaded the ESP GDI+ sample starter gauge, but I simply cannot find where the bitmaps are being called.

 

In the root project folder, there is a folder called "res". Inside the res folder, I see:

  • gauge_background.bmp
  • HeadingArrow.bmp
  • HeadingBackground.bmp

 

However, in the code, I only see:

	Gdiplus::Bitmap* mBackgroundBitmap;	// Image used for the background of our 'heading' component
	Gdiplus::Image*	mArrowBitmap;		// Image used as the indicator for our 'heading' component

But digging around the code, there is nowhere that points mArrowBitmap to the HeadingArrow.bmp bitmap. How will Visual Studio know it should use HeadingArrow.bmp when there aren't anywhere in the code that states mArrowBitmap = HeadingArrow.bmp?

 

Is this all done in the file called GDIPlus_GaugeRes.rc? Because the .rc is the only file my Visual Studio express will not allow me to open.

 

Thanks in advance,

3HSAJHT.png

TFDi Design

  • Commercial Member

Go study the SDK on how a gauge is defined using the gauge macros. You're missing a ton of information. Also look at the header files, where there's even more defined.

Ed Wilson

Mindstar Aviation
My Playland - I69

  • Author
  • Commercial Member

Thanks Ed. I went through the ESP guide and turns out yup, the resource bitmaps are defined in the .rc file.

 

Well, now I gotta find a way to open .rc files; Visual Studio tells me I need to pay in order to edit them

3HSAJHT.png

TFDi Design

  • Moderator

Thanks Ed. I went through the ESP guide and turns out yup, the resource bitmaps are defined in the .rc file.

 

Well, now I gotta find a way to open .rc files; Visual Studio tells me I need to pay in order to edit them

Right-click on the .rc in the Solution Explorer window and Open in Text mode.

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
  • Author
  • Commercial Member

Ah got it working and I see the linking of the bitmaps in the .rc file. Thanks Bill, thanks again Ed.

 

And yup I know ESP != FSX. I am using the P3D SDK, but since it's originally ESP I thought I'd look at those examples from Microsoft's website with the C++ gauge tutorial. 

3HSAJHT.png

TFDi Design

What's the reason for using Visual Studio Express instead of Community Edition? The Community edition seems much more capable.

Barry Friedman

  • Author
  • Commercial Member

I haven't experimented with Community Edition; I've used VS2013 with C# for a bit last year, so that was my go-to Visual Studio when I decided to try gauge development.

 

I'll download CE and give it a shot. Hopefully my GDI+ gauge originally built for VS2010 still runs... Creating a backup now B)

3HSAJHT.png

TFDi Design

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.