Solved

Compiling RES files

Posted on 2000-03-02
12
229 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

808 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