Re: Headers common to .cpp and .rc files



Tom Serface wrote:
I see Alex already answered you question, but if you manually modify the
.RC file you may have problems if you use the RC editor to add or remove
resources in the future since it takes liberties in rewriting the file.

// prevent editing with the resource editor
#ifdef APSTUDIO_INVOKED
# error this file is not editable by Microsoft Visual C++
#endif

I don't remember where I saw this, but it is contained in all our version.rc
files which only contain a manually-edited version that gets its version
numbers from a common header file.

I typically do "extra" things in the .RC2 file that is created since
there is no way of controlling how the editor rewrites the .RC file.
It does include the .RC2 file automatically so that is a handy place
to do your own things. You may already know this, but I figured I'd
throw it out anyway...

Just for the record: there is no compelling reason to have an .RC2 file at
all, safe that it is generated by default for MFC projects. However, you
can also add a resource file to e.g. a console program or DLL. If it
contains the version resources, you can easily check those out by the
properties dialog of Explorer or by the tooltip when just hovering the
mouse above it.

cheers

Uli

--
C++ FAQ: http://parashift.com/c++-faq-lite

Sator Laser GmbH
Geschäftsführer: Michael Wöhrmann, Amtsgericht Hamburg HR B62 932
.



Relevant Pages

  • Release of RosAsm V.2.007b
    ... Review of the Dialog Editor Function for Loading a Dialog Template from ... First release of Diego Fraga review of the Resources Manager, ... Debugger Memory Inspector. ...
    (alt.lang.asm)
  • RE: cant see my menu item
    ... Hi, Kirk. ... I edited the resources file with a text editor and I saw that there ... The first item is a pop-up, ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: Program Resources
    ... editor that was able to give access to the resources within a program. ... change displayed text, and modify screens. ... just google for "resource editor" ...
    (microsoft.public.windowsxp.basics)
  • Re: ELF loading
    ... How do you want to loose a Source that is comming with the ... as well as Resources and all? ... You can also load the PE in an Editor like Ultra-Edit, ...
    (alt.lang.asm)
  • Re: Preprocessor symbols ignored in .RC file
    ... Look in the Resources section of the project properties. ... Also, if you hand edit the .rc file in an MFC project, your changes may get ... I always do this kind of thing in the .rc2 file. ...
    (microsoft.public.vc.mfc)