|
-
July 15th, 2011, 04:30 PM
#8
Re: Loading a bitmap in-code with XPM file
 Originally Posted by Gatleos
So... how exactly do I define a resource ID? I've created a .rc file containing this:
IDB_ASCII_SQUARE BITMAP "Art\CURSES_SQUARE.bmp"
IDB_ASCII_TERMINAL BITMAP "ART\CURSES_TERMINAL.bmp"
and included it under "resources" in my project, then created a resource.h file. I assume this will make my project include the resource files in the executable at compile time. But how do I define these resources in resource.h? Does the .rc file have to be #included by resource.h? What is the scope of the LoadBitmap() function?
Yes, you should place
Code:
#include "resource.h"
at the top of your rc file, and wherever you call LoadBitmap() from.
In the resource.h you should have something like that:
Code:
#define IDB_ASCII_SQUARE 101
#define IDB_ASCII_TERMINAL 102
Don't understand your "scope" question.
Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
Convenience and productivity tools for Microsoft Visual Studio:
FeinWindows - replacement windows manager for Visual Studio, and more...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|