Discussion:
.RC2 Files
(too old to reply)
Jonathan Wood
2003-11-01 13:07:05 UTC
Permalink
Can anyone explain the purpose of RC2 files generated automatically for MFC
applications?

Looking at it, it appears that the content of these files are included in
the compilation of the main RC file, but that those resources included in
the RC2 file are not modified in any way or are editable by the MFC wizards.

I needed to include some resources from other files and so I added them to
my RC2 file. Everything compiles great but there's just one problem: none of
the resources defined there are available to my application at run time
(i.e. the resources are apparently not compiled into the EXE).

I see my main RC file includes the RC2 file, but it does so using the
TEXTINCLUDE resources, which I don't entirely understand.

Thanks.
--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
Joseph M. Newcomer
2003-11-01 17:44:26 UTC
Permalink
Try opening your executable file in "resource" mode and look at the resources. There is a
possibility that, if you did not include the appropriate .h files in your resource build,
that a resource of the form

MYRESOURCE MENU
BEGIN
END

is stored under its string name "MYRESOURCE", not under some integer your program may be
using to try to access it. That would be my first guess.

joe
Post by Jonathan Wood
Can anyone explain the purpose of RC2 files generated automatically for MFC
applications?
Looking at it, it appears that the content of these files are included in
the compilation of the main RC file, but that those resources included in
the RC2 file are not modified in any way or are editable by the MFC wizards.
I needed to include some resources from other files and so I added them to
my RC2 file. Everything compiles great but there's just one problem: none of
the resources defined there are available to my application at run time
(i.e. the resources are apparently not compiled into the EXE).
I see my main RC file includes the RC2 file, but it does so using the
TEXTINCLUDE resources, which I don't entirely understand.
Thanks.
Joseph M. Newcomer [MVP]
email: ***@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
Jonathan Wood
2003-11-01 18:09:56 UTC
Permalink
Joseph,
Post by Joseph M. Newcomer
Try opening your executable file in "resource" mode and look at the resources. There is a
possibility that, if you did not include the appropriate .h files in your resource build,
that a resource of the form
MYRESOURCE MENU
BEGIN
END
is stored under its string name "MYRESOURCE", not under some integer your program may be
using to try to access it. That would be my first guess.
Yep, opened my EXE and, sure enough, the resources being #included in my RC2
file are not compiled into the EXE.

Unfortunately, I don't have a good understanding for exactly how the
TEXTINCLUDE stuff (which is how RC2 files are included in my main RC file)
works so I'm kind of stumped as to how to troubleshoot this.

Thanks.
--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
Joseph M. Newcomer
2003-11-03 03:15:49 UTC
Permalink
Largely you don't have to worry about TEXTINCLUDE at all. First, you should already have
the .rc2 file included anyway, so that shouldn't take any effort. Second, if you want to
modify the include list, you go to View | Resource Includes and add what you need there,
and never worry about the TEXTINCLUDE stuff at all. I've touched this resource perhaps
twice in eight years of MFC programming.
joe
Post by Jonathan Wood
Joseph,
Post by Joseph M. Newcomer
Try opening your executable file in "resource" mode and look at the
resources. There is a
Post by Joseph M. Newcomer
possibility that, if you did not include the appropriate .h files in your
resource build,
Post by Joseph M. Newcomer
that a resource of the form
MYRESOURCE MENU
BEGIN
END
is stored under its string name "MYRESOURCE", not under some integer your
program may be
Post by Joseph M. Newcomer
using to try to access it. That would be my first guess.
Yep, opened my EXE and, sure enough, the resources being #included in my RC2
file are not compiled into the EXE.
Unfortunately, I don't have a good understanding for exactly how the
TEXTINCLUDE stuff (which is how RC2 files are included in my main RC file)
works so I'm kind of stumped as to how to troubleshoot this.
Thanks.
Joseph M. Newcomer [MVP]
email: ***@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
Jonathan Wood
2003-11-03 16:18:29 UTC
Permalink
Joseph,
Post by Joseph M. Newcomer
Largely you don't have to worry about TEXTINCLUDE at all. First, you should already have
the .rc2 file included anyway, so that shouldn't take any effort. Second, if you want to
modify the include list, you go to View | Resource Includes and add what you need there,
and never worry about the TEXTINCLUDE stuff at all. I've touched this resource perhaps
twice in eight years of MFC programming.
"Largely" being the operative word here. When the IDE screws up, as the .NET
IDE does so often, then sometimes ya gots to dig a little deeper.
--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
Continue reading on narkive:
Loading...