 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
John Runyan Guest
|
Posted: Wed Jul 07, 2004 10:23 pm Post subject: Storing Bitmaps |
|
|
I have a bitmap in the RES file for my component. I load the bitmap with
the following code:
if ( this->ComponentState.Contains(csDesigning) )
this->FScrollDown->Glyph->LoadFromResourceName((int)HInstance,
"SCROLLDOWN");
I needed the if csDesigning because at design time the HInstatnce refers to
the res of the component. At runtime this causes an error "Resource
"SCOLLDOWN" not found"
I expected the bitmap to be streamed for me but that didn't work. At
runtime there is no bitmap.
Where do I save the bitmap to? Where do I locate the code?
Thanks.
--
John Runyan
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Wed Jul 07, 2004 10:53 pm Post subject: Re: Storing Bitmaps |
|
|
"John Runyan" <jrunyan (AT) necassociates (DOT) com> wrote
| Quote: | I needed the if csDesigning because at design time the
HInstatnce refers to the res of the component. At runtime
this causes an error "Resource "SCOLLDOWN" not found"
|
You are using the wrong HInstance value when calling LoadFromResourceName().
You need to use the FindClassHInstance() function instead, ie:
FScrollDown->Glyph->LoadFromResourceName(FindClassHInstance(__classid(TMyCom
ponent)), "SCROLLDOWN");
This way, you also don't need to check the csDesigning flag at all, either.
Gambit
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|