This is not correct:
image = .Image~getImage("IDB_BITMAP1") -- Create an image from the
The first argument has to either be a number, in which case the number is
taken to be the resource ID of one of the system provided images, or a file
name. Since this is not a number, (the getImage() method does not support
symbolic IDs at this time,) it is taken to be a file name.
If you add this to your message:
say "TestView-initDialog-02: image =" image 'err code:'
you will see this output:
TestView-initDialog-02: image = an Image err code: 2
The system error code, 2, is 'The system cannot find the file specified.'
Change to this and it works:
image = .Image~getImage("CustList.BMP") -- Create an image from the
By the way, I misread your code in your first e-mail and thought you were
printing Error when the returned image from setImage was .nil. This code
that you have is correct:
if \ image~isNull then do
oldImage = stImage~setImage(image)
if oldImage \== .nil then oldImage~release
say "TestView-initDialog-03: Error! Image is Null!"
There is a couple of other gotchas in your approach.
1.) The parser for .rc files ignores the BITMAP statement:
IDB_BITMAP1 BITMAP ".\\CustList.BMP"
so there's no way to access a bitmap from a RcDialog. If you compiled the
resource file into a resource only DLL, you could grab the bitmap image
using the .ResourceImage class.
Well, I guess that is only 1 gotcha. There are currently methods to us an
Icon resource from a .rc file. Matching methods for a bitmap can be added
as an enhancement in the future.
On Tue, Feb 14, 2012 at 4:06 PM, Oliver Sims <
> Many thanks, Mark.. Attached are the files. Run TestView.rex.
> Hope it's not me!!!
> The static has a style of WS_BORDER - I tried it without this style but no