Board index » cppbuilder » Read of addreess in dsnide50.bpl

Read of addreess in dsnide50.bpl


2007-07-30 07:22:29 AM
cppbuilder40
Hi there
I have just made a new component
An ImagePanel and every thing works fine when I am testing
it (creating it from code) but when I install it and
drop it on a form I get an AV:
Read of addreess 0000004 in dsnide50.bpl
the panel draws fine though.
I get the same error if I try to move the panel.
When the component is dropped on the form it actually
looks just like a panel, there is no Image loaded yet.
I have added msimg32.lib to my package in oder to use
TransparentBlt, but without that the linker isn't satisfied.
Anybody have some suggestion what I should look for.
Thanks in advance
Asger
 
 

Re:Read of addreess in dsnide50.bpl

Hi Again
Now I have tryed to comment out all the code inside the functions,
but I still get the av, read of addres.
I use TPicture* and TBitmap* in the component, but there is
nothing created untill I asign the picture.
Hope somebody can help.
Thanks in advance
Asger
 

Re:Read of addreess in dsnide50.bpl

Hi again
Found the error!
Aparntly I am not alowed to wait creating the TPicture
untill there is an Image asigned, BCB don't know how to
deal with a TPicture Property = 0 at design time.
Everything works fine now.
Hope I didn't waite anybodys time.
Kind regards
Asger
 

{smallsort}

Re:Read of addreess in dsnide50.bpl

"Asger Jorgensen" < XXXX@XXXXX.COM >wrote in message
Quote
Aparntly I am not alowed to wait creating the
TPicture untill there is an Image asigned, BCB
don't know how to deal with a TPicture
Property = 0 at design time.
It will work fine if the property getter creates the TPicture dynamically
when the property is accessed fir the first time. The IDE and DFM don't
care when the TPicture is created, just so long as it is valid when they
need it. For example:
{
private:
TPicture *fPicture;
__published:
__property TPicture* Picture = {read=GetPicture, write=SetPicture};
};
TPicture* __fastcall TMyComp::GetPicture()
{
if( fPicture == NULL )
fPicture = new TPicture;
return fPicture;
}
void __fastcall TMyComp::SetPicture(TPicture *Value)
{
this->Picture->Assign(Value);
}
Gambit