Board index » delphi » Can anyone tell me if this is supposed to work?

Can anyone tell me if this is supposed to work?

Hi,
  I have 4 .RES files (5 if you count the one that Delphi automatically
creates) all containing 13 bitmap images.  I am trying to use 5 TImage
components in Delphi 1 so I can load 5 random images.  I have tried
this:

  Image1.picture.bitmap.handle :=
LoadBitMap(hInstance,IntToStr(RandomNumber));
  . . .

it compiles, but I get no image.  I have this in the project source: {$R
*.RES} so it should be binding all the .RES files in the current
directory, to the application right?  It seems like it cannot read the
images in the .RES files?  is there some kind of limit to the amout of
resource files you can use?

thanks for any and all help
Mike
 Please reply by e-mail thanks.
--
 -- Everyone has desires to see what lies behind locked doors...
    Censorship suckS!
    Graphic Illusions - http://www.netcom.com/~g-illus

 

Re:Can anyone tell me if this is supposed to work?


Mike <g-il...@ix.netcom.com> wrote in article
<32AF0C23.5...@ix.netcom.com>...

Quote
> Hi,
>   I have 4 .RES files (5 if you count the one that Delphi automatically
> creates) all containing 13 bitmap images

[snip]

Quote
> I have this in the project source:
> {$R *.RES} so it should be binding all the .RES files in the current
> directory, to the application right?

Nope; {$R *.RES} loads in the resource file with the same name as
the source file it's written in. You will need to explicitly specify the
other 4 RES files in their own {$R ...} clauses.

Chris.

Re:Can anyone tell me if this is supposed to work?


The * in {$R *.RES} stands for the current filename,
ans is therefore, NOT a wildcard! You need to include
every file seperately with more $R statements.

Mike <g-il...@ix.netcom.com> schreef in artikel
<32AF0C23.5...@ix.netcom.com>...

Quote
> Hi,
>   I have 4 .RES files (5 if you count the one that Delphi automatically
> creates) all containing 13 bitmap images.  I am trying to use 5 TImage
> components in Delphi 1 so I can load 5 random images.  I have tried
> this:

>   Image1.picture.bitmap.handle :=
> LoadBitMap(hInstance,IntToStr(RandomNumber));
>   . . .

> it compiles, but I get no image.  I have this in the project source: {$R
> *.RES} so it should be binding all the .RES files in the current
> directory, to the application right?  It seems like it cannot read the
> images in the .RES files?  is there some kind of limit to the amout of
> resource files you can use?

> thanks for any and all help
> Mike
>  Please reply by e-mail thanks.
> --
>  -- Everyone has desires to see what lies behind locked doors...
>     Censorship suckS!
>     Graphic Illusions - http://www.netcom.com/~g-illus

Other Threads