Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: TWebBrowser dynamic creation

1 view
Skip to first unread message

idt...@gmail.com

unread,
Jun 16, 2019, 2:19:22 AM6/16/19
to
Τη Παρασκευή, 15 Σεπτεμβρίου 2000 - 10:00:00 π.μ. UTC+3, ο χρήστης Alex Bosetti έγραψε:
> Hi all
>
> I am trying to dynamically create a TWebBrowser when the form shows.
> I am using the same syntax as for any other control, but it wont' accept the
> parent assignment.
> If I don't specify it I don't get any error, but the control is not visible
> on the form.
> What am I doing wrong?
>
>
> Thanks for your help (Alex)
>
> This is what I do
>
> TWebBrowser *b = new TWebBrowser(this);
> b->Parent = this; /* doesn't compile -> cannot convert TForm* const to
> _di_IDispatch
> b->Align = alClient;

Dont forget #include "SHDocVw_OCX.h"

b->TOleControl::Parent = this;
b->TOleControl::Name = AnsiString(WebBrowser);
b->TOleControl::Align = alClient;
//
b->Navigate(StringToOleStr("http://www.google.com"));
0 new messages