Q: Help with Multiple .bmp's and using .rc2 
Author Message
 Q: Help with Multiple .bmp's and using .rc2

hello,
i am creating a screen saver that uses multiple bitmaps, but
as of now i can only show one. My .rc2 looks like this...

#ifdef APSTUDIO_INVOKED

#error this file is not editable by Microsoft Visual C++
#endif //APSTUDIO_INVOKED

IDB_BITMAP1 bitmap res\bitmap1.bmp
IDB_BITMAP2 bitmap res\bitmap2.bmp

However if I use any other ID than IDB_BITMAP I get the following
error..

Saver.cpp
Saverwnd.cpp
Drawwnd.cpp
C:\Msdev\Projects\1.0\Drawwnd.cpp(103) : error C2065: 'IDB_BITMAP1' :
undeclared identifier
Generating Code...
Error executing cl.exe.
Saver.scr - 1 error(s), 0 warning(s)

Why is it I can only use ID_BITMAP? I have looked at several MFC
samples and they
use many different IDs for many bitmaps.
thanks,

jeremy



Mon, 31 Jul 2000 03:00:00 GMT  
 Q: Help with Multiple .bmp's and using .rc2


Fri, 19 Jun 1992 00:00:00 GMT  
 Q: Help with Multiple .bmp's and using .rc2

Just add the following line the top of drawwnd.cpp

#include "resource.h"

---------------------------



Quote:
>hello,
>i am creating a screen saver that uses multiple bitmaps, but
>as of now i can only show one. My .rc2 looks like this...

>#ifdef APSTUDIO_INVOKED

>#error this file is not editable by Microsoft Visual C++
>#endif //APSTUDIO_INVOKED

>IDB_BITMAP1 bitmap res\bitmap1.bmp
>IDB_BITMAP2 bitmap res\bitmap2.bmp

>However if I use any other ID than IDB_BITMAP I get the following
>error..

>Saver.cpp
>Saverwnd.cpp
>Drawwnd.cpp
>C:\Msdev\Projects\1.0\Drawwnd.cpp(103) : error C2065: 'IDB_BITMAP1' :
>undeclared identifier
>Generating Code...
>Error executing cl.exe.
>Saver.scr - 1 error(s), 0 warning(s)

>Why is it I can only use ID_BITMAP? I have looked at several MFC
>samples and they
>use many different IDs for many bitmaps.
>thanks,

>jeremy



Mon, 31 Jul 2000 03:00:00 GMT  
 Q: Help with Multiple .bmp's and using .rc2

Create another file called (any filename will do), say "bitmaps.rh" that
has the content...
-----
#define IDB_BITMAP1 9001 // this number must be a unique resource
identifier
#define IDB_BITMAP2 9002 // this one too
-----
Now, include this file in your .rc2 by adding the following line of code to
the .rc2 file...
-----
#include "bitmaps.rh"
-----
Now you can include this resource header in your source files to use the
identifiers, IDB_BITMAP1 and IDB_BITMAP2 to refer to the previous
resources.
I hope this helps you.
--

MiddleWorld SoftWare - http://web2.ica.net/middleworld
--------------------------------------------------
He went out of his way to be good.



Quote:
> hello,
> i am creating a screen saver that uses multiple bitmaps, but
> as of now i can only show one. My .rc2 looks like this...

> #ifdef APSTUDIO_INVOKED

> #error this file is not editable by Microsoft Visual C++
> #endif //APSTUDIO_INVOKED

> IDB_BITMAP1 bitmap res\bitmap1.bmp
> IDB_BITMAP2 bitmap res\bitmap2.bmp

> However if I use any other ID than IDB_BITMAP I get the following
> error..

> Saver.cpp
> Saverwnd.cpp
> Drawwnd.cpp
> C:\Msdev\Projects\1.0\Drawwnd.cpp(103) : error C2065: 'IDB_BITMAP1' :
> undeclared identifier
> Generating Code...
> Error executing cl.exe.
> Saver.scr - 1 error(s), 0 warning(s)

> Why is it I can only use ID_BITMAP? I have looked at several MFC
> samples and they
> use many different IDs for many bitmaps.
> thanks,

> jeremy



Tue, 01 Aug 2000 03:00:00 GMT  
 Q: Help with Multiple .bmp's and using .rc2


Fri, 19 Jun 1992 00:00:00 GMT  
 Q: Help with Multiple .bmp's and using .rc2

I'm sort of curious why you have these declarations in the .rc2 file.
What is missing is that in resource.h you should have the declarations
of #define IDB_BITMAP1 and #define IDB_BITMAP2.  If you created these
bitmaps in the .rc file, the resource editor would have created these
definitions for you.  Since you appear to have added them by hand to
the rc2 file yourself (an unusual way, as I say), you don't have the
symbols defined.  If you *do* have the symbols defined, you have not
included the header file in the compilation of the file that gives the
error.  
                                joe


Quote:
>hello,
>i am creating a screen saver that uses multiple bitmaps, but
>as of now i can only show one. My .rc2 looks like this...

>#ifdef APSTUDIO_INVOKED

>#error this file is not editable by Microsoft Visual C++
>#endif //APSTUDIO_INVOKED

>IDB_BITMAP1 bitmap res\bitmap1.bmp
>IDB_BITMAP2 bitmap res\bitmap2.bmp

>However if I use any other ID than IDB_BITMAP I get the following
>error..

>Saver.cpp
>Saverwnd.cpp
>Drawwnd.cpp
>C:\Msdev\Projects\1.0\Drawwnd.cpp(103) : error C2065: 'IDB_BITMAP1' :
>undeclared identifier
>Generating Code...
>Error executing cl.exe.
>Saver.scr - 1 error(s), 0 warning(s)

>Why is it I can only use ID_BITMAP? I have looked at several MFC
>samples and they
>use many different IDs for many bitmaps.
>thanks,

>jeremy

Joseph M. Newcomer

http://www3.pgh.net/~newcomer


Wed, 02 Aug 2000 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. C's Qs

2. Using Resource .RES files to stick .bmp's and .wav files into .exe

3. HELP WITH BMP'S!!!!!!!!!!!!

4. Using multiple pch's in a project

5. Get access to a view's member var from another view using multiple templates

6. Multiple SDK's for EVC++ using the same CPU

7. View BMP imromation program with 'Dll'

8. View BMP imromation program with 'Dll'

9. Tool to help reduce multiple #include's

10. Help returning multiple int's from func...

11. Need Help using DLL with 'C'

12. Help: Sol'n of linear eq's using full pivoting

 

 
Powered by phpBB® Forum Software