xsharp.eu • Constant redefinition warnings RX4005 when working in VO Windows-Editor
Page 1 of 3

Constant redefinition warnings RX4005 when working in VO Windows-Editor

Posted: Mon Nov 09, 2020 11:39 am
by ArneOrtlinghaus
When we save changes in the VO Windows-Editor we get Warning messages of the following type:

C:projectsxsharpIOSsrcIosMsgWdtaMsgProjekte_vodtaMsgProjekte_vo.tabMsgPrjFTP_vo.rc(17,0): warning RC4005: 'DS_CONTROL' : redefinition
C:projectsxsharpIOSsrcIosMsgWdtaMsgProjekte_vodtaMsgProjekte_vo.tabMsgPrjFTP_vo.rc(18,0): warning RC4005: 'ES_AUTOVSCROLL' : redefinition
C:projectsxsharpIOSsrcIosMsgWdtaMsgProjekte_vodtaMsgProjekte_vo.tabMsgPrjFTP_vo.rc(20,0): warning RC4005: 'ES_WANTRETURN' : redefinition
C:projectsxsharpIOSsrcIosMsgWdtaMsgProjekte_vodtaMsgProjekte_vo.tabMsgPrjFTP_vo.rc(21,0): warning RC4005: 'WS_BORDER' : redefinition
C:projectsxsharpIOSsrcIosMsgWdtaMsgProjekte_vodtaMsgProjekte_vo.tabMsgPrjFTP_vo.rc(22,0): warning RC4005: 'WS_CHILD' : redefinition
C:projectsxsharpIOSsrcIosMsgWdtaMsgProjekte_vodtaMsgProjekte_vo.tab

Is it possible to omit these warnings without having to disable these warnings completely?

Thanks
Arne

Constant redefinition warnings RX4005 when working in VO Windows-Editor

Posted: Mon Nov 09, 2020 12:09 pm
by robert
Arne,
Are you including a RC file with a line #include "win32apilibary.vh"

Robert

Constant redefinition warnings RX4005 when working in VO Windows-Editor

Posted: Mon Nov 09, 2020 4:34 pm
by ArneOrtlinghaus
Robert,

no, there aren't any includes to vh anymore.
We make our conversion with the VOXPorter and an own converter that is called afterwards.
The number of warnings is rising with every VO Window that I save.
The dlls have a reference to the VOWin32APILibrary, it is the DLL from the redist folder from 02.10.2020.

The VO Designer is the update Chris has sent me on 22.10.2020.

Arne

Constant redefinition warnings RX4005 when working in VO Windows-Editor

Posted: Mon Nov 09, 2020 4:47 pm
by Chris
Hi Arne,

Please open the .rc file in question, do you see something strange about it?

I assume it has indeed multiply defined values (or an #include as Robert pointed out). What happens if you remove the duplicates, do they get added again after you modify the window?

Constant redefinition warnings RX4005 when working in VO Windows-Editor

Posted: Mon Nov 09, 2020 4:48 pm
by ArneOrtlinghaus
I have found a difference.
Before any changes the constant ES_READONLY is defined as
#define ES_READONLY 2048
and no warnings are generated.

Afterwards the constant is defined as
#define ES_READONLY 0x00000800

Constant redefinition warnings RX4005 when working in VO Windows-Editor

Posted: Mon Nov 09, 2020 4:52 pm
by ArneOrtlinghaus
I can delete the constants in one rc-File. Then I get error messages about undefined keywords. When saving in the VO Editor, then they are regenerated as hex numbers.

Arne

Constant redefinition warnings RX4005 when working in VO Windows-Editor

Posted: Mon Nov 09, 2020 4:53 pm
by Chris
Hi Arne,
ArneOrtlinghaus wrote:I can delete the constants in one rc-File. Then I get error messages about undefined keywords. When saving in the VO Editor, then they are regenerated as hex numbers.
Do you still get errors after that?

Constant redefinition warnings RX4005 when working in VO Windows-Editor

Posted: Tue Nov 10, 2020 8:52 am
by ArneOrtlinghaus
Hi Chris,

yes, it remains like this, I get the same warnings.
When I manually edit the .RC-File
and write
#define ES_READONLY 2048
instead of
#define ES_READONLY 0x00000800
then the warning message for ES_READONLY vanishes.
To see this behavior at least two dialogs must be in the same project: One dialog unchanged after conversion and one dialog modified by the VO Editor. So it seems to be this different writing of constants.

Constant redefinition warnings RX4005 when working in VO Windows-Editor

Posted: Tue Nov 10, 2020 9:36 am
by robert
Arne, Chris,
We can probably fix this generating not only a #define but also an #undef
#undef ES_READONLY
#define ES_READONLY 0x00000800
This makes the RC files a bit larger but prevents warnings when the Resource Compiler finds defines that are defined elsewhere.

Robert

Constant redefinition warnings RX4005 when working in VO Windows-Editor

Posted: Tue Nov 10, 2020 10:00 am
by ArneOrtlinghaus
Robert,
I don't know the consequences. 2048 and 0x00000800 give both decimal 2048, so internally they should represent the same value.

Arne