From: Mark M. <mie...@gm...> - 2011-09-12 14:21:14
|
Sending my reply to the list also in case anyone is interested. Hi Oliver, The problem seems to be with resEdit.exe. When I compile the .rc file into a .dll using Microsoft's tools, things work just fine. To compile a .rc file into a .dll file, you need both rc.exe and link.exe. While rc.exe is included in the Windows SDKs, most of them don't include link.exe. You'd be better off getting the free Visual C++ express. It contains all the command line tools to both compile a resource-only dll and to compile any C/C++ program. You can compile the ooRexx package using Visual C++ express. Download the also free NSIS package and you can build your own ooRexx installation package on Windows without any problem. One reason for compiling your own ooRexx is that the changes we are committing to ooDialog go into main. Then I have to merge those changes into switchOODialog before you can access them. If you build your own ooRexx, you can get the latest changes as soon as they are committed. You do not need to know any C or C++ to build a distribution. Once you get the free tools, building the Windows installation package is as simple as typing "makeorx.bat" on the command line. If you go that route and have any problems just ask a few questions. It is not that hard to install Visual C++ Express, but if you do have a problem a few questions will quickly get you straightened out. Do a google search of: Visual C++ Express and it will take you to the download of Visual C++ Express. Here is a Rexx program I use to compile resource-only DLLs: -- Compile a resource script file to a resource only DLL (a binary resource.) -- Assumes, the Microsoft tools are in the path. -- First arg is the resource script file name, without the extension. The -- second arg is optional and can be used to rename the output DLL file. use arg cmdLine if arg(1, 'O') then return doHelp() parse var cmdLine inFile outFile . if outFile == "" then outFile = inFile inFile = inFile'.rc' if \ haveTools() then return doHelp() 'rc -r -fo'outFile'.res' inFile 'link' outFile'.res /NOENTRY /DLL /MACHINE:X86 /OUT:'outFile'.dll' return 0 -- Simplistic check for rc.exe to see if the tools are accessible. ::routine haveTools 'rc /? > nul 2>&1' rcRet = RC if rcRet <> 0 then do say "rx.exe or link.exe (or both) do not appear to be in the path." return .false end return .true ::routine doHelp say say "makeDLL: compile a resource only DLL using Microsoft's tools." say 'rc.exe and link.exe must be in the path.' say say 'Syntax: makeDll rcFile [outFile]' say 'where rcFile is the input file, leave off the .rc extension.' say 'outFile is optional, used to rename the output file.' say say 'Examples:' say 'makeDll OpenWatcom' say ' Compiles OpenWatcom.rc producing OpenWatcom.dll.' say say 'makeDll OpenWatcom OpenWatcomMS' say ' Compiles OpenWatcom.rc producing OpenWatcomMS.dll.' return 0 On Wed, Sep 7, 2011 at 4:46 PM, Oliver Sims < oli...@si...> wrote: > ** > Mark, please find the files attached. > > I wondered if it was a ResEdit problem. > > Do you happen to know off-hand whether the free MS development kit can > compile .rc files into DLLs? > If so, maybe it would be better to use that. ResEdit does seem to compile > the DLLs very quietly! > > Many thanks, > > Oliver > > PS - the value for IDI_ICON1 is 101. > > PPS - This problem is a long way from being on the critical path, so no > huge rush. But it's annoying... > > > ------------------------------ > *From:* Mark Miesfeld [mailto:mie...@gm...] > *Sent:* 07 September 2011 18:45 > > *To:* Open Object Rexx Users > *Subject:* Re: [Oorexx-users] ooDialog - Problem with Dialog Icon in > aResDialog. > > Hi Oliver, > > On Wed, Sep 7, 2011 at 10:59 AM, Oliver Sims < > oli...@si...> wrote: > >> Further to my last: I'm using ooDialog 4.2.0 7120 (which I'm almost sure >> is >> the latest download - although the download file says it's build 7123). >> >> I did some further investigation with the simplest program possible (and >> with the default ResEdit dialog but with an icon resource added): >> >> ================================================ >> /* Test a Dialog Icon with an RcDialog */ >> >> .Application~setDefaults("O", "myDlg.h", .false) >> dlg = .MyDlg~new("myDlg.rc", "IDD_DIALOG1") >> dlg~execute("SHOWTOP", "IDI_ICON1") >> >> ::requires ooDialog.cls >> >> ::class myDlg subclass RcDialog >> ================================================ >> >> This worked fine. My dialog icon was there at the top left of the dialog. >> >> Then I compiled a resource DLL (using ResEdit) from the .rc file used with >> the above, and ran the same program but as a ResDialog: >> >> ================================================ >> /* Test a Dialog Icon with a ResDialog */ >> .Application~setDefaults("O", "myDlg.h", .false) >> dlg = .MyDlg~new("myDlg.dll", "IDD_DIALOG1") >> dlg~execute("SHOWTOP", "IDI_ICON1") >> >> ::requires ooDialog.cls >> >> ::class myDlg subclass ResDialog >> ================================================ >> >> My dialog icon did not appear - I got the default dialog icon. >> >> Any thoughts? >> > > You must be doing something wrong. <grin> > > Seriously though, the only thing I can think of is the value of IDI_ICON1. > Is it less than 16? (Although if it is, it shouldn't have worked in the > RcDialog.) > > You'll need to send me all the files, .rc, .h, etc., so I can take a look > at them One suspicion is that resEdit is not correctly compiling the .dll > file. > > Send the files to my gmail account. Probably won't be able to reply until > next week. > > -- > Mark Miesfeld > > |