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

Constant redefinition warnings RX4005 when working in VO Windows-Editor

Posted: Wed Nov 11, 2020 9:28 am
by robert
Chris,

I thought about that too, but that only works when a customer (re)opens and saves all the forms.

Robert

Constant redefinition warnings RX4005 when working in VO Windows-Editor

Posted: Wed Nov 11, 2020 10:08 am
by FFF
Robert,
i'm certainly not qualified to comment - but "more control" always sounds good to me.
If your 5) would possibly allow including 4), i.e. making the proces smarter, i'd vote for it.

Constant redefinition warnings RX4005 when working in VO Windows-Editor

Posted: Wed Nov 11, 2020 12:57 pm
by ArneOrtlinghaus
Chris,
we tested with the newest version of the VOXPorter we have. It writes the constants as decimal values and not as hex values.

Arne

Constant redefinition warnings RX4005 when working in VO Windows-Editor

Posted: Wed Nov 11, 2020 1:22 pm
by HansjoergP
At the moment the VOXPorter defines the values as int. It is read in the array of xPorter.SDKDefines[cUpper] as string. In theory it is possible to convert it to a int64 and format it as a hexstring in Generate_Resources in the following case

CASE xPorter.SDKDefines:ContainsKey(cUpper)

Hansjörg

Constant redefinition warnings RX4005 when working in VO Windows-Editor

Posted: Wed Nov 11, 2020 1:58 pm
by robert
Guys,
Regardless of what the XPorter does, I will add a setting to the project file (and in the project settings dialog) in the next build that allows you to suppress warnings from the resource compiler about duplicate defines (RC4005)
What should the default be:
- suppress the warnings ?
- show the warnings ?

Robert

Constant redefinition warnings RX4005 when working in VO Windows-Editor

Posted: Wed Nov 11, 2020 2:59 pm
by ArneOrtlinghaus
In my opinion the duplicate constant warning from the resource compiler is not critical, as the constants are defined just there locally. So the default could be "Suppress".

Arne

Constant redefinition warnings RX4005 when working in VO Windows-Editor

Posted: Wed Nov 11, 2020 3:44 pm
by Chris
I agree, it's best to suppress the warnings by default.

Constant redefinition warnings RX4005 when working in VO Windows-Editor

Posted: Wed Nov 11, 2020 4:18 pm
by VR
Hansjörg was able to fix this problem. First, he updated the source of the VOXPorter. That had no effect on the created .rc files. After debugging the VOXPorter, we were able to identify the source of the problem and fix it. Hansjörg changed the following Line from

Code: Select all

aDefines:Add(cUpper , String.Format("#define {0} {1}" , cWord , cValue))
to

Code: Select all

aDefines:Add(cUpper , String.Format("#define {0} 0x{1:x8}" , cWord , Int64.Parse(cValue)))
By doing so, the defines in the .rc files changed from

Code: Select all

#define WS_CHILD 1073741824
to

Code: Select all

#define WS_CHILD 0x40000000
Since the define numbers format is now equal to the format, that the form designer generates, the warnings disappeared.

Constant redefinition warnings RX4005 when working in VO Windows-Editor

Posted: Wed Nov 11, 2020 7:50 pm
by Chris
Hi Volkmar,

That's a good idea, will update also the standard VOXporter code to emit values in hex format.

But in any case, by default VOXporter (at least the version that is available since some months ago) does not emit #define statements anyway at all, it instead uses the actual values everywhere they are needed in the resource files. This was done in order to avoid similar problems to the one we are discussing now, and this feature can be disabled by unchecking the option "ReplaceResourceDefinesWithValues"