Solved

Compiling RES files

Posted on 2000-03-02
12
220 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
 
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now