On Thu, 23 Feb 2006 18:05:07 +0200
"A.J. Venter" <[EMAIL PROTECTED]> wrote:
> It's a bug in ipro.
> I checked the code at the stack trace and found this:
> function TIpHtmlInternalPanel.HtmlPanel: TIpHtmlCustomPanel;
> begin
> Result := TIpHtmlPanel(Parent);
> while (Result.ClassType <> TIpHtmlPanel) do
> Result := TIpHtmlPanel(Result.Parent);
> end;
>
> The exception gets thrown in the while line.
It means, the TIpHtmlInternalPanel expects to have a TIpHtmlCustomPanel
parent.
It should be
while not (Result is TIpHtmlPanel) do
> Now WHY they do it this way I do not know, but it means you get a real
> problem if you derive a component from it.
> I commented out the lines in the function like so:
> function TIpHtmlInternalPanel.HtmlPanel: TIpHtmlCustomPanel;
> begin
> //Result := TIpHtmlPanel(Parent);
> // while (Result.ClassType <> TIpHtmlPanel) do
> // Result := TIpHtmlPanel(Result.Parent);
> end;
>
> And now my test program works as beautifully as you could wish.
?
But now the Result is undefined.
> From the context I get the idea this is somehow used if you wish to embed
> two htmlpanels inside one another, which doesn't affect me - but the
> method they are using is NOT good because it causes crashes if you derive
> anything (which changes the classtype of course).
>
> So do I report a bug ? Or how does this get fixed ?
Please check above fix. If it works, I will change it.
Mattias
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives