Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Compiling RES files

Posted on 2000-03-02
12
Medium Priority
?
244 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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 100 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

Technology Partners: 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!

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

715 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