Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

2 rc files in one project

35 views
Skip to first unread message

Don HO

unread,
Nov 28, 2003, 9:21:51 PM11/28/03
to
When I have 2 rc files in one project, the compiler (visual c++ 7) complains
then stops, it finishes the compilation and linking when I execute again the
compilation. How can I avoid this problem? thanx

--
Don HO

Je bouffe donc je suis


Russ Freeman

unread,
Nov 29, 2003, 8:48:27 PM11/29/03
to
"Don HO" <do...@altern.org> wrote in message
news:3fc802bb$0$28611$636a...@news.free.fr...

> When I have 2 rc files in one project, the compiler (visual c++ 7)
complains
> then stops, it finishes the compilation and linking when I execute again
the
> compilation. How can I avoid this problem? thanx

An RC file isn't anything special just plain old text. RC files can include
other RC files and other text files. Jost open your RC file in your
favourite plain text editor and write an include for your second RC file.

--
russ.
http://www.gipsysoft.com/articles/winspector/ - FREE Spy++ replacement.
http://www.gipsysoft.com/qhtm/ - FREE HTML display in a small and light DLL
http://www.gipsysoft.com/ZoomPlus/ - Programmers Zoom Utility on Steroids


Don HO

unread,
Nov 30, 2003, 1:20:35 PM11/30/03
to
Russ,

Thanx for the advice. It works fine now with MinGW (gcc).
Anyway, I have always the problem with visual c++ 7, the following messages
show
during the compilation :
CVTRES : fatal error CVT1100: duplicate resource. type:DIALOG, name:1800,
language:0x0409

LINK : fatal error LNK1123: failure during conversion to COFF: file invalid
or corrupt

even so I enclose the filexxx.rc and resource.h with the :
#ifndef SOMBOL0
#define SOMBOL0
#endif

How can I walk arround this problem?


"Russ Freeman" <ru...@gipsysoft.com> a écrit dans le message de news:
uhOlNQu...@tk2msftngp13.phx.gbl...

Mihai N.

unread,
Nov 30, 2003, 4:00:06 PM11/30/03
to
"Don HO" <do...@altern.org> wrote in
news:3fca34eb$0$27032$626a...@news.free.fr:

> CVTRES : fatal error CVT1100: duplicate resource. type:DIALOG, name:1800,
> language:0x0409

Did you check if this is not the case? Check if a dialog with the same ID is
not present in both resource files. The message is pretty clear.

> even so I enclose the filexxx.rc and resource.h with the :
> #ifndef SOMBOL0
> #define SOMBOL0
> #endif

This only protects you from including THE SAME file twice.
But you said you have two files.

--
Mihai
-------------------------
Replace _year_ with _ to get the real email

Don HO

unread,
Dec 1, 2003, 2:49:02 PM12/1/03
to
Hi, Mihai,

I just checked the constant 1800, there's no duplication. Then I changed the
value of this constant,
The same message error, except the const 1800.

in the secondary rc file :

#include "UserDefineResource.h"
IDD_USER_DEFINE_BOX DIALOG 0, 0, 229, 393

STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER |

WS_CAPTION | WS_POPUP | WS_SYSMENU

EXSTYLE WS_EX_TOOLWINDOW

CAPTION "User Define"

FONT 8, "MS Shell Dlg"

BEGIN

GROUPBOX "1st group",IDC_STATIC,15,21,198,55

EDITTEXT IDC_COMBO_G1_EDIT,24,33,124,14,ES_AUTOHSCROLL

...

END

in the "UserDefineResource.h"

#ifndef USERDEFINE_RC_H

#define USERDEFINE_RC_H

#ifndef IDC_STATIC

#define IDC_STATIC -1

#endif

// User Define Dialog

#define IDD_USER_DEFINE_BOX 1800

#define IDC_COMBO_G1_COLOR (IDD_USER_DEFINE_BOX + 1)

#define IDC_COMBO_G2_COLOR (IDD_USER_DEFINE_BOX + 2)

...

#endif //USERDEFINE_RC_H


Where is the problem?

"Mihai N." <nmihai_y...@yahoo.com> a écrit dans le message de news:
Xns94438450...@207.46.248.16...

Guillaume

unread,
Dec 2, 2003, 10:34:23 AM12/2/03
to
> An RC file isn't anything special just plain old text. RC files can include
> other RC files and other text files. Jost open your RC file in your
> favourite plain text editor and write an include for your second RC file.

Including files in RC files is fine, as well as putting in it any
preprocessor directive. But (the big but, if I may say so ;) ) Visual
C++'s resource editor will wipe away all of those mods if you modify
some resources with it and save them. That's very annoying.

If you know of a means for it not to do that, just tell me.

Don HO

unread,
Dec 2, 2003, 2:55:56 PM12/2/03
to
hi Guillaume,

Yes, you can walk arround this problem - never edit rc file with VC++ !
Use notepad++, that's a good source editor witch colourise symtaxically the
rc file!

download it at : http://notepad-plus.sourceforge.net/


"Guillaume" <grs-N...@NO-mail.com> a écrit dans le message de news:
uo6d$mOuDH...@tk2msftngp13.phx.gbl...

Russ Freeman

unread,
Dec 2, 2003, 3:02:07 PM12/2/03
to
"Guillaume" <grs-N...@NO-mail.com> wrote in message
news:uo6d$mOuDH...@tk2msftngp13.phx.gbl...

Not if you add the includes the way it wants them. My RC file includes
version information and the include looks like this:
3 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""version.rc""\0"
END

You would add this in MSDEV by right-clicking on the resource and going from
the context menu.

Don HO

unread,
Dec 2, 2003, 5:11:53 PM12/2/03
to
YOU MAKE MY DAY, RUSS!!!
Now it compiles and links perfectely.
Thank you very much!

--
Don HO

Je bouffe donc je suis

"Russ Freeman" <ru...@gipsysoft.com> a écrit dans le message de news:
erZbr8Qu...@TK2MSFTNGP12.phx.gbl...

0 new messages