Solved

Compiling RES files

Posted on 2000-03-02
12
230 Views
Last Modified: 2010-04-04
I've written a piece of code that SUPPOSEDLY compiles resource files. All it's doing is ShellExecuting brc32.exe but does it want to work? Oh no.

Will somebody mind telling me what's wrong with this:

ShellExecute(0, 'open', 'c:\program files\borland\delphi5\bin\brc32.exe', '-r c:\langstrings.rc', '', SW_SHOWNORMAL);

What would also be nice would be a solution too.

And before anyone asks, the file paths and names are valid

Why the hell is this going wrong? Why am I going to get the sack? Who cares anyway? etc etc etc

The Neil =:(
0
Comment
Question by:TheNeil
12 Comments
 
LVL 6

Expert Comment

by:edey
ID: 2577159
what happens if you change:

'c:\program files\borland\delphi5\bin\brc32.exe', '-r c:\langstrings.rc'

to:

'c:\program files\borland\delphi5\bin\brc32.exe -r c:\langstrings.rc'

?



GL
Mike
0
 
LVL 17

Expert Comment

by:inthe
ID: 2577222
HI
probably a stupid comment but just checking you know that "brc32.exe" should be "brcc32.exe" i think.
0
 
LVL 5

Author Comment

by:TheNeil
ID: 2577236
You get a lovely 'File not found' error out.

This is driving me up the wall

The Neil =:(
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Author Comment

by:TheNeil
ID: 2577245
Inthe

I've tried that as well and it just doesn't compile the file (What's the difference between brc32 and brcc32 by the way?)

The Neil
0
 
LVL 17

Expert Comment

by:inthe
ID: 2577294
just checked BRCC32 is like BRC32 -r.
BRCC32 only compiles resources into .RES files. BRC32 can also bind the resources to an .EXE
so you should be ok.i pop back to windows and make test to see what happens.
0
 
LVL 17

Expert Comment

by:inthe
ID: 2577324
ps.
the delphi bin directory should already be in windows path so you could try:
winexec('brc32.exe -r c:\langstrings.rc',sw_normal);
0
 
LVL 17

Accepted Solution

by:
inthe earned 25 total points
ID: 2577396
HI
tested solution:

procedure TForm1.Button1Click(Sender: TObject);
begin
winexec('brc32.exe -r c:\langstrings.rc',sw_normal);
end;

or sw_hide/sw_hidden if you dont want dos box appearing..

Regards Barry
0
 
LVL 6

Expert Comment

by:DrDelphi
ID: 2577431
Try two things:

1. outside of your application, try compiling the resource file. you're assuming that the ShellExecute is failing when it could be that the RC file is not right.

2. Assuming that your RC file is okay, try using short pathnames in the shellexecute. for Exmple:

ShellExecute(handle,'Open','C:\Progra~1\borland\delphi5\bin\brcc32.exe','-r resfile.rc','',SW_SHOWNORMAL);


I have heard of instances where a path name with a space in it will not get interpreted as you'd expect. This would eliminate that as a possible cause. BTW, I took a RC file of my own and ran it through your ShellExecute with no trouble. I'm thinking that your RC is the culprit.



Good Luck!!
0
 

Expert Comment

by:JimboKern69
ID: 2577940
I have had a small utility that can compile 16-bit and/or 32-bit RC files into RES.

You can download the source files from my web-site at:

http://www.geocities.com/jim_kern

I have never had a problem with this, and I know that it compiles in Delphi 3,4 & 5 without a problem.

Jim Kern
0
 
LVL 17

Expert Comment

by:inthe
ID: 2578029
you are using winexec like i did some comments above.

winexec works fine , shellexecute on the other hand also fails for me ..
0
 
LVL 3

Expert Comment

by:ckaneta
ID: 2578208
ummmm
0
 
LVL 5

Author Comment

by:TheNeil
ID: 2586927
Cheers Barry,

No idea why ShellExecute was failing but WinExec seems to be working so I'm not complaining.

The Neil
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question