Sign in to follow this  
Lashrathius

Resource elements in C++ gauge

Recommended Posts

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,

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

An .rc file is a text file. If you need proof... load one into notepad. :)

 

Also, be careful... ESP is not FSX.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this