Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamicly creating internet explorers

Status
Not open for further replies.

lobOnline

Programmer
Apr 5, 2001
12
NL
I'm trying to make a program that can open multiple sessions of a TCppWebBrowser component. The problem I have is that I can't seem to create it dynamicly (at runtime). I'm doing something (don't have the actual code here) like this, when opening a new session:

noSessions++;
browsers[noSessions] = new TCppWebBrowser(MainForm);
browsers->Left = 0;
browsers->Top = 0;
browsers->Width = 100;
browsers->Height = 300;
// browsers->Parent = MainForm; <- can't do this
browsers->Show();

Well this won't show a new internet explorer on my MainForm. I've tried it with a button and it worked fine, but I have to fill the Parent property (TComponent) so the object knows where the button has to be drawn. The Parent property for TCppWebBrowser for the TComponent can't be filled because the TCppWebBrowser itself has a Parent property too.

Does anybody know how to solve this problem? I'm really stuck here so any response would be appreciated.

 
I was able to make it work, so forget I ever asked it. The actual code is this:

TTabSheet *pPage = new TTabSheet(this);
pPage->PageControl = Sessions;
pPage->TabVisible = true;
pPage->Caption = &quot;New&quot;;

noBrowsers++;
browsers[noBrowsers] = new TCppWebBrowser(MainForm);
browsers[noBrowsers]->Left = 0;
browsers[noBrowsers]->Top = 0;
browsers[noBrowsers]->TabStop = true;
browsers[noBrowsers]->TabOrder = 0;
browsers[noBrowsers]->ParentWindow = pPage->Handle;
browsers[noBrowsers]->Width = pPage->Width;
browsers[noBrowsers]->Height = pPage->Height;
browsers[noBrowsers]->Show();

It creates a browser on a TPageControl.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top