Constant redefinition warnings RX4005 when working in VO Windows-Editor

This forum is meant for questions and discussions about the X# language and tools
User avatar
ArneOrtlinghaus
Posts: 384
Joined: Tue Nov 10, 2015 7:48 am
Location: Italy

Constant redefinition warnings RX4005 when working in VO Windows-Editor

Post 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
User avatar
robert
Posts: 4225
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Constant redefinition warnings RX4005 when working in VO Windows-Editor

Post by robert »

Arne,
Are you including a RC file with a line #include "win32apilibary.vh"

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
ArneOrtlinghaus
Posts: 384
Joined: Tue Nov 10, 2015 7:48 am
Location: Italy

Constant redefinition warnings RX4005 when working in VO Windows-Editor

Post 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
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Constant redefinition warnings RX4005 when working in VO Windows-Editor

Post 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?
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
User avatar
ArneOrtlinghaus
Posts: 384
Joined: Tue Nov 10, 2015 7:48 am
Location: Italy

Constant redefinition warnings RX4005 when working in VO Windows-Editor

Post 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
User avatar
ArneOrtlinghaus
Posts: 384
Joined: Tue Nov 10, 2015 7:48 am
Location: Italy

Constant redefinition warnings RX4005 when working in VO Windows-Editor

Post 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
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Constant redefinition warnings RX4005 when working in VO Windows-Editor

Post 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?
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
User avatar
ArneOrtlinghaus
Posts: 384
Joined: Tue Nov 10, 2015 7:48 am
Location: Italy

Constant redefinition warnings RX4005 when working in VO Windows-Editor

Post 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.
User avatar
robert
Posts: 4225
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Constant redefinition warnings RX4005 when working in VO Windows-Editor

Post 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
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
ArneOrtlinghaus
Posts: 384
Joined: Tue Nov 10, 2015 7:48 am
Location: Italy

Constant redefinition warnings RX4005 when working in VO Windows-Editor

Post 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
Post Reply