product information in converted VO application

This forum is meant for questions and discussions about the X# language and tools
leighproman
Posts: 60
Joined: Tue Oct 11, 2016 8:56 pm
Location: UK

product information in converted VO application

Post by leighproman »

Redacted version of version.rc attached.
Thanks
Leigh
Attachments
version.zip
(466 Bytes) Downloaded 19 times
User avatar
Chris
Posts: 4584
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

product information in converted VO application

Post by Chris »

Hi Leigh,

Hmm, not sure why, but indeed this doesn't work, until I add this in the beginning of the .rc file:

#define VS_VERSION_INFO 1

This should fix the problem for you, will try to find out why this happens...
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
leighproman
Posts: 60
Joined: Tue Oct 11, 2016 8:56 pm
Location: UK

product information in converted VO application

Post by leighproman »

Thanks Chris - that's working for me now.
Leigh
User avatar
Chris
Posts: 4584
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

product information in converted VO application

Post by Chris »

Thanks for the feedback Leigh! Still puzzled why it silently does not work properly without it...
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
User avatar
robert
Posts: 4262
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

product information in converted VO application

Post by robert »

Chris,
The versioninfo resource MUST have resource type 1. In VO the define VS_VERSION_INFO is automatically replaced with 1 because VO finds it in the Win32 API library, even when this library is not included in the libs of the App. (yes that is weird, but that is how the original VO developers designed things).

If your app does not have any native resources (rc files) then the X# compiler creates a version info resource based on the information in the AssemblyVersion, AssemblyFileVersion etc attributes

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
Chris
Posts: 4584
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

product information in converted VO application

Post by Chris »

Robert,

What I was puzzled about, is what the resource compiler substitutes "VS_VERSION_INFO" info with, when you do not specify the define. Apparently it substitutes it with nothing, VS_VERSION_INFO is inserted as a string in this case.

Strange thing though is that if you do not specify "VS_VERSION_INFO" at all in the .rc file, but use the value 1 directly, then the string "VS_VERSION_INFO" does still appear embedded in the compiled resource!!! Looks to me like some weird hack MS has done here...
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

product information in converted VO application

Post by Karl-Heinz »

Hi Chris,

the resource compiler is a special beast. It doesn´t complain when i change e.g. a created manifest.rc content from :

1 24 Resourcescctl6.man

To e.g.:

GAGA1 GAGA2 Resourcescctl6.man

Of course, this works ;-)

#define GAGA1 1
#define GAGA2 24

GAGA1 GAGA2 Resourcescctl6.man


BTW. It´s no showstopper, but i noticed that a newer XPorter version exports something like:

xyz ( NULL )

to:

xyz ( @@NULL )

which results in the error: "The name 'NULL' does not exist in the current context".

.
regards
Karl-Heinz
User avatar
Chris
Posts: 4584
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

product information in converted VO application

Post by Chris »

Hi Karl-Heinz,

Thanks, this has been fixed already in the VOXporter for the next build (tomorrow probably).

About the resource compiler, yeah it is really bizarre how it works some times. Btw, try saving a .rc file in unicode format, compile, see the errors it produces and try to figure out what the problem is by the error messages...:)
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

product information in converted VO application

Post by Karl-Heinz »

Hi Chris,

have you tried in the meantime to find out why the XPorter doesn't export the version info ? If not, add a leading char ( e.g. "_" ) to "VS_VERSION_INFO", so that the VO Resource line looks like:

RESOURCE _VS_VERSION_INFO VERSIONINFO

instead of:

RESOURCE VS_VERSION_INFO VERSIONINFO

Now the XPorter creates a resource file, and when i change in the rc file the line

_VS_VERSION_INFO VERSIONINFO

to:

1 VERSIONINFO

or:

#define VS_VERSION_INFO 1
VS_VERSION_INFO VERSIONINFO

the version infos are visible.


regards
Karl-Heinz
User avatar
Chris
Posts: 4584
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

product information in converted VO application

Post by Chris »

Hi Karl-Heinz,

Yeah, I had totally forgotten about it, but had actually added explicit code to not port this resource, because of problems with some of the defines (not only VS_VERSION_INFO). Will enable it back, not sure if this will make it in this or the next build though.
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
Post Reply