Re: OpenPictureDialog Problems
- From: cybatech@xxxxxxxxxxxxx
- Date: Sun, 24 Jul 2005 01:23:16 GMT
Thanks Guys but I'm still getting accessvoilation. It maybe the
Tmanyshape component. The component is here
http://www.delphi32.com/vcl/1221/ Like I said I am new to this so any
help is greatly appreciated.
On Sun, 24 Jul 2005 10:56:49 +1000, "Henry Bartlett"
<hambar@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>"Rob Kennedy" <me3@xxxxxxxxxxx> wrote
>
><snip a whole bunch of insightful remarks about my rather stupid
>comments> 8-)
>
>You are quite right of course. As you say, the OP needs to get into
>the habit of using meaningful names for his components.
>
>And, if he had added comments showing what each of his methods is
>intended to do, it would have made it easier to help him.
>
>
>Having looked more closely at the code I suggest that the OP should
>set a private form variable in the onMouseDown handler
>
>e.g. fCurrentShape:
>
>and in the MouseDownOnShape method:
>
> if Sender is TManyShape then
> begin
> fCurrentShape := tManyShape (Sender);
>// safe because we have established that "Sender is TManyShape "
>etc...
>
>Then he has a known alias that he can use in Button1Click instead of
>the meaningless local variable.
>
>If Assigned (fCurrentShape) then
> fCurrentShape.Image := Bitmap;
>
>or probably better, depending on how tManyShape.Image is implemented
>
>.If Assigned (fCurrentShape) then
> fCurrentShape.Image.LoadFromFile(OpenPicDlg.FileName);
.
- Follow-Ups:
- Re: OpenPictureDialog Problems
- From: Henry Bartlett
- Re: OpenPictureDialog Problems
- From: Rob Kennedy
- Re: OpenPictureDialog Problems
- References:
- OpenPictureDialog Problems
- From: cybatech
- Re: OpenPictureDialog Problems
- From: Maarten Wiltink
- Re: OpenPictureDialog Problems
- From: cybatech
- Re: OpenPictureDialog Problems
- From: Henry Bartlett
- Re: OpenPictureDialog Problems
- From: Rob Kennedy
- Re: OpenPictureDialog Problems
- From: Henry Bartlett
- OpenPictureDialog Problems
- Prev by Date: Re: OpenPictureDialog Problems
- Next by Date: Re: OpenPictureDialog Problems
- Previous by thread: Re: OpenPictureDialog Problems
- Next by thread: Re: OpenPictureDialog Problems
- Index(es):