Silverfrost Forums

Welcome to our forums

Problems with resource script

12 Dec 2022 2:46 #29689

Hi

I am using Plato and I am having trouble with my resource script. This file, LV_Resources.rc, contains only one line:

LV_Map BITMAP Deutschland_Map.bmp

When this is compiled this error-message occurs:

Compiling file LV_Resources.rc using SRC. [Silverfrost SRC/WIN32 Ver 4.60 Copyright (c) Silverfrost Ltd 2022] Access violation: The instruction at address 1001884e attempted to read from location 158ca000 100187a8 read_bytes#2C [+00a6]

10018a82 __read [+02c3]

1001ecec fread [+02b3]

00437e68 BITMAP_RSC::convertToRBJ(<ptr>char) [+00c0]

004320c1 RESOURCES::convertToRBJ(<ptr>char,int) [+0093]

0042b489 convertResourcesToRBJ(<ptr>char) [+0021]

0042a672 compile_resource(void) [+0b40]

0040172f top_level_parser(enumᅣtl_context) [+001e]

eax=0098a000 ebx=00000006 ecx=158ca000 edx=00000000 esi=00000006 edi=101a6644 ebp=0377f7a8 esp=0377f764 IOPL=0 ds=002b es=002b fs=0053 gs=002b cs=0023 ss=002b flgs=00010206 [NC EP NZ SN DN NV] 0360/2820 TSTK=5 [ ] 1001884e movb dl,[ecx]

10018850 movb [ebp-0x15],dl

Compilation completed with no errors.

Linking failed due to the missing LV_resources.obj-file.

What was wrong? The 24-bit-bitmap is in the same directory as the program code.

Cheers Norbert

12 Dec 2022 4:27 #29690

There is nothing obviously wrong with what you are doing. Perhaps the bmp file is corrupt. Off hand I don't know if the resource compiler needs to read the file.

You could put the bmp file on DropBox and send a link. Then I could test it out.

12 Dec 2022 5:15 #29691

Thanks Paul,

here is the link to my dropbox.

https://www.dropbox.com/s/x21fb8axxjadegt/Deutschland_Map.bmp?dl=0

The image shows fine in any grafik display software like paint or gimp.

Cheers Norbert

12 Dec 2022 6:29 #29692

I have found the resource compiler very picky about syntax.

In the example below, because spaces are in the file name, it has to be in quotes, AND all the backslashes have to be doubles.

greensquare bitmap z:\cmasterf95\green16check.bmp cjdwp bitmap 'z:\\CMASTERF95\\BMP and Icons\\cjd_color_splashbw.bmp'

12 Dec 2022 7:41 #29693

Norbert

I can confirm that SRC fails for this bmp file.

I will log this for investigation.

12 Dec 2022 8:54 #29694

Okay, thank you.

Some additional information: This file was created with gimp (GNU Image manipulation program). Just now I triedd all available options (24 bit, 32 bit, colorinformation included or not) all with the same result. And the same result with using Paint from MS.

Cheers Norbert

13 Dec 2022 7:52 #29695

Norbert

It may be a little while before this can be sorted out. My first thought is to wonder if the failure only occurs when the file size is very large. At the moment it looks like I will need to send you a new SRC.exe.

13 Dec 2022 8:27 #29696

Norbert

As a temporary work-around you could read the bitmap directly from the file. For example:

iw = winio@('%bm[]')

There are also other contexts where you can use curly brackets in order to read a resource directly from a file.

13 Dec 2022 5:27 #29697

Thanks Paul, I will give it a try.

Cheers Norbert

14 Dec 2022 9:39 #29700

I can confirm that resource space is limited to 10 million bytes. We will work to increase that.

15 Dec 2022 10:19 #29704

thanks. I will get along with this workaround.

Please login to reply.