Solved

Compiling RES files

Posted on 2000-03-02
12
225 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

774 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