BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Resource file format

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Non-Technical)
View previous topic :: View next topic  
Author Message
Eyyub Volkan Çektimur
Guest





PostPosted: Wed Jul 14, 2004 1:58 pm    Post subject: Resource file format Reply with quote



Hi,

how can i find windows resource file format ? and what type of resource
format does borland uses ? (i mean in .res file which informations are
included ?) i need to parse and (maybe) regernerate .res file. thanks for
help.

--
________________________________________
Eyyub Volkan Çektimur
Proya Software & Trade Inc.
Head of Core Development Department


Back to top
Ed Mulroy [TeamB]
Guest





PostPosted: Wed Jul 14, 2004 2:42 pm    Post subject: Re: Resource file format Reply with quote



Borland uses the standard format for compiled resource files.

http://www.wotsit.org/
and
http://www.shorl.com/fupresopojore
or, in its long form
http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/resources/introductiontoresources/resourcefileformats.asp

The resource file is created by using the resource compiler on a
source file, a *.RC file. The format of statements in such a file is
in the help files and more elaborate descriptions are given here.
http://www.shorl.com/fybagysotygra
or, in its long form
http://msdn.microsoft.com/library/en-us/tools/tools/resource_definition_statements.asp

Imagedit.exe is a utility which is included in the C++ Builder
distribution. It will display some of the contents of the compiled
resource file.

Resource Hacker will do most anything with such files.
http://www.users.on.net/johnson/resourcehacker/

.. Ed

Quote:
Eyyub Volkan Çektimur wrote in message
news:40f53b95 (AT) newsgroups (DOT) borland.com...

how can i find windows resource file format ? and what
type of resource format does borland uses ? (i mean in
.res file which informations are included ?) i need to parse
and (maybe) regernerate .res file. thanks for help.



Back to top
Eyyub Volkan Çektimur
Guest





PostPosted: Thu Jul 15, 2004 7:09 am    Post subject: Re: Resource file format Reply with quote



thanks

--
________________________________________
Eyyub Volkan Çektimur
Proya Software & Trade Inc.
Head of Core Development Department


Back to top
Oliver Rutsch
Guest





PostPosted: Fri Jul 16, 2004 7:57 am    Post subject: Re: Resource file format Reply with quote

Hi Eyyub Volkan Çektimur,
Quote:
Hi,

how can i find windows resource file format ? and what type of resource
format does borland uses ? (i mean in .res file which informations are
included ?) i need to parse and (maybe) regernerate .res file. thanks for
help.


I think you're still working on a tool to change all File Version
numbers in a project group, right?
This is a great idea, because it takes a lot of time to change all
versions in a large project group (we have more than 40 projects!) on
all computers. We made the same experiences as you and we stopped
working on it as we recognized that we need to change the .res file, too.
If you're interested in the code to parse and change the .bpr file then
don't hesitate to contact me.
A tool to automate this boring task would be great!

Bye,

--
Dipl. Ing. Oliver Rutsch
EMail: [email]orutsch (AT) sympatec (DOT) com[/email]
Sympatec GmbH

Back to top
Eyyub Volkan Çektimur
Guest





PostPosted: Fri Jul 16, 2004 10:12 am    Post subject: Re: Resource file format Reply with quote

Hi,

Yes, i wanted to do something like that. parsing .bpr file is simple, but
..res file is a bit complicated. I successfully read .res file and version
info, but when i wanted to re-write (re-create) it , i failed. i read "win32
resource file formats" chapter of msdn, and follow that way, but always the
created .res file differs from orginal one. (Especially when increasing the
size of version info (1.0.0.2 to 1.0.0.10)) i have trouble with "padding"
info of that structures. Anyway, if i succeed , i will notify you.
________________________________________
Eyyub Volkan Çektimur
Proya Software & Trade Inc.
Head of Core Development Department
"Oliver Rutsch" <orutsch (AT) sympatec (DOT) com> wrote

Quote:
Hi Eyyub Volkan Çektimur,
Hi,

how can i find windows resource file format ? and what type of resource
format does borland uses ? (i mean in .res file which informations are
included ?) i need to parse and (maybe) regernerate .res file. thanks
for
help.


I think you're still working on a tool to change all File Version
numbers in a project group, right?
This is a great idea, because it takes a lot of time to change all
versions in a large project group (we have more than 40 projects!) on
all computers. We made the same experiences as you and we stopped
working on it as we recognized that we need to change the .res file, too.
If you're interested in the code to parse and change the .bpr file then
don't hesitate to contact me.
A tool to automate this boring task would be great!

Bye,

--
Dipl. Ing. Oliver Rutsch
EMail: [email]orutsch (AT) sympatec (DOT) com[/email]
Sympatec GmbH



Back to top
Angus Johnson
Guest





PostPosted: Fri Jul 16, 2004 2:18 pm    Post subject: Re: Resource file format Reply with quote

Quote:
Yes, i wanted to do something like that. parsing .bpr file is simple, but
.res file is a bit complicated. I successfully read .res file and version
info, but when i wanted to re-write (re-create) it , i failed. i read
"win32
resource file formats" chapter of msdn, and follow that way, but always
the
created .res file differs from orginal one. (Especially when increasing
the
size of version info (1.0.0.2 to 1.0.0.10)) i have trouble with "padding"
info of that structures. Anyway, if i succeed , i will notify you.


It's been a few years since I've looked at this code - and looking at it
now, it'f far from pretty.
Nevertheless, it does work, so if you're happy to decipher the Delphi code
it should give you
a fair idea of the required layout ...

Hope it helps ...
Angus J.

=======================================================

procedure CompileVersionInfo;
const
wZero: word = $0;
var
w: word;
dw: dword;
i, len1, len2: integer;
ws: widestring;
SizeOfSfiSection_Offset,
RemainingSizeOfSfiSection_Offset: integer;
SizeOfSfiSection: integer;
begin
//VS_VERSION_INFO length (will fix up later but 0 for now)
fStream.Write(wZero,sizeof(wZero));
w := sizeof(TVS_FIXEDFILEINFO);
fStream.Write(w,2);
fStream.Write(wZero,sizeof(wZero)); //binary (not text)
ws := 'VS_VERSION_INFO';
fStream.Write(ws[1],(length(ws)+1)*2);
while fStream.position mod 4 <> 0 do fStream.Write(w,2);
fStream.Write(ffi, sizeof(ffi)); //TVS_FIXEDFILEINFO
while fStream.position mod 4 <> 0 do fStream.Write(wZero,sizeof(wZero));

SizeOfSfiSection_Offset := fStream.Position;
dw := 0; //SizeOfSfiSection (0 for now)
fStream.Write(dw,sizeof(dw));

fStream.Write(wZero,sizeof(wZero)); //binary (not text)
ws := 'StringFileInfo';
fStream.Write(ws[1],(length(ws)+1)*2);
while fStream.position mod 4 <> 0 do fStream.Write(wZero,sizeof(wZero));

RemainingSizeOfSfiSection_Offset := fStream.Position;
fStream.Write(dw,sizeof(dw)); // (0 for now)
fStream.Write(wZero,sizeof(wZero)); //binary (not text)
ws := sfi_Lang_charset;
fStream.Write(ws[1],(length(ws)+1)*2);
while fStream.position mod 4 <> 0 do fStream.Write(wZero,sizeof(wZero));
for i := 0 to sl1.count -1 do
begin
len1 := (length(sl1[i])+1)*2;
len2 := (length(sl2[i])+1)*2;
//calculate record size (with padding)
w := 6 + len1;
if w mod 4 <> 0 then inc(w,2);
inc(w,len2);
if w mod 4 <> 0 then inc(w,2);
fStream.Write(w,2); //record size

w := len2; //length of value string
fStream.Write(w,2);
w := 1; //text (not binary)
fStream.Write(w,2);
ws := sl1[i];
fStream.Write(ws[1],len1);
while fStream.position mod 4 <> 0 do
fStream.Write(wZero,sizeof(wZero));
ws := sl2[i];
fStream.Write(ws[1],len2);
while fStream.position mod 4 <> 0 do
fStream.Write(wZero,sizeof(wZero));
end;

SizeOfSfiSection := fStream.Position - SizeOfSfiSection_Offset;
while fStream.position mod 4 <> 0 do fStream.Write(wZero,sizeof(wZero));

dw := $44; //SizeOfVarFileInfoSection
fStream.Write(dw,4);
fStream.Write(wZero,sizeof(wZero)); //binary (not text)
ws := 'VarFileInfo';
fStream.Write(ws[1],(length(ws)+1)*2);
while fStream.position mod 4 <> 0 do fStream.Write(wZero,sizeof(wZero));
w := $24; //record size
fStream.Write(w,2);
w := 4; //value size = 4 bytes
fStream.Write(w,2);
fStream.Write(wZero,sizeof(wZero)); //binary (not text)
ws := 'Translation';
fStream.Write(ws[1],(length(ws)+1)*2);
while fStream.position mod 4 <> 0 do fStream.Write(wZero,sizeof(wZero));
w := vfi_Lang;
fStream.Write(w,2);
w := vfi_charset;
fStream.Write(w,2);
fStream.position := 0;
w := fStream.Size;
fStream.Write(w,2);
fStream.position := SizeOfSfiSection_Offset;
dw := SizeOfSfiSection;
fStream.Write(dw,4);
fStream.position := RemainingSizeOfSfiSection_Offset;
dw := SizeOfSfiSection-$24;
fStream.Write(dw,4);
end;



Back to top
Simon Macneall
Guest





PostPosted: Sun Jul 18, 2004 11:54 pm    Post subject: Re: Resource file format Reply with quote

On Fri, 16 Jul 2004 09:57:50 +0200, Oliver Rutsch <orutsch (AT) sympatec (DOT) com>
wrote:

Quote:
I think you're still working on a tool to change all File Version
numbers in a project group, right?
This is a great idea, because it takes a lot of time to change all
versions in a large project group (we have more than 40 projects!) on
all computers. We made the same experiences as you and we stopped
working on it as we recognized that we need to change the .res file, too.
If you're interested in the code to parse and change the .bpr file then
don't hesitate to contact me.
A tool to automate this boring task would be great!


Why don't you just dump the borland auto generated Version info and add an
..rc file with your version stuff in it? This is what we have done for all
our projects and it makes life much easier. One simple script file can
change the version info for any and all projects. You can also share the
rc file across multiple projects if they share the same version numbers.
Just uncheck the "Include version information in project" on the Version
Info tab of project options, and add a simple rc file.

We have actually gone as far as dumping the borland res file completely,
and put all images in via rc file too, as this allows us to change the
images without having to manually readd them to the project.


Simon

Back to top
Eyyub Volkan Çektimur
Guest





PostPosted: Mon Jul 19, 2004 9:30 am    Post subject: Re: Resource file format Reply with quote

thanks for the suggestion, i have already finished to read/write .res file.
but your suggestion is much sensible. is there any article to learn that
resource (.rc) language ?

--
________________________________________
Eyyub Volkan Çektimur
Proya Software & Trade Inc.
Head of Core Development Department


Back to top
Ed Mulroy [TeamB]
Guest





PostPosted: Mon Jul 19, 2004 10:55 am    Post subject: Re: Resource file format Reply with quote

Quote:
... is there any article to learn that resource (.rc) language ?

The resource file is created by using the resource compiler on a
source file, a *.RC file. The format of statements in such a file is
in the help files and more elaborate descriptions are given here.
http://www.shorl.com/fybagysotygra
or, in its long form
http://msdn.microsoft.com/library/en-us/tools/tools/resource_definition_statements.asp

.. Ed

Quote:
Eyyub Volkan Çektimur wrote in message
news:40fb9420$1 (AT) newsgroups (DOT) borland.com...



Back to top
Eyyub Volkan Çektimur
Guest





PostPosted: Mon Jul 19, 2004 11:43 am    Post subject: Re: Resource file format Reply with quote

thanks

________________________________________
Eyyub Volkan Çektimur
Proya Software & Trade Inc.
Head of Core Development Department


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Non-Technical) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.