Can anyone tell me why the second cast fails to compile in Delphi 7?
var
WebBrowser: TWebBrowser;
begin
WebBrowser := TWebBrowser.Create(Self);
TWinControl(WebBrowser).Parent := Self;
(WebBrowser as TWinControl).Parent := Self; // fail here
end
Parent in TWebBrowser is a read-only IDispatch property, but why does the first cast see the TWinControl parent property ok but the second one does not?
Thanks