 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Brad Guest
|
Posted: Fri Jul 07, 2006 8:10 am Post subject: Deriving a control from TCppWebBrowser |
|
|
Hi!
I've googled my fingers to the bone looking for a solution to this problem, but have had no luck whatsoever. Here's hoping that someone can help me:
I'm trying to derive a control from TCppWebBrowser.
In Main.h I have:
class TCppWebBrowserEx : public TCppWebBrowser
{
public:
__fastcall TCppWebBrowserEx(TComponent* Owner) : TCppWebBrowser(Owner) {};
};
And then in Main.cpp I have:
TCppWebBrowserEx *pBrowser = new TCppWebBrowserEx(this);
pBrowser->TOleControl::Parent = PageControl->ActivePage;
pBrowser->Align = alClient;
pBrowser->Navigate(WideString("about:blank"));
The last Navigate command is causing an access violation. If I change the first line to "TCppWebBrowser *pBrowser = new TCppWebBrowser(this)", everything works as expected.
Is there anything I'm doing wrong? Do I need to do something else to get this working? Or is it that you just can't subclass TCppWebBrowser at all in this way like you can with other controls, because it's a wrapper for an ActiveX control?
Any help will be IMMENSELY appreciated.
Thanks in advance.
Brad. |
|
| Back to top |
|
 |
Mark Guerrieri Guest
|
Posted: Fri Jul 07, 2006 6:47 pm Post subject: Re: Deriving a control from TCppWebBrowser |
|
|
| Quote: | Is there anything I'm doing wrong? Do I need to do something else to get
this working? Or is it that you just can't subclass TCppWebBrowser at all
in this way like you can with other controls, because it's a wrapper for
an ActiveX control?
|
Try setting Visible to true prior to calling Navigate for the first time. I
seem to remeber similat problems in BCB6 when calling Navigate on a new
instance of a derived browser. For me, showing the form first solved the
problem, but this may be unrelated.
Mark |
|
| Back to top |
|
 |
Brad Harding Guest
|
Posted: Sat Jul 08, 2006 6:30 am Post subject: Re: Deriving a control from TCppWebBrowser |
|
|
Thanks for your assistance, Mark, but unfortunately it doesn't solve the problem. Putting "pBrowser->Visible = true" before the Navigate command doesn't seem to make any difference, and the access violation is still raised...
Brad.
"Mark Guerrieri" <mguerrieri (AT) no_spam_verizon (DOT) net> wrote:
| Quote: | Try setting Visible to true prior to calling Navigate for the first time. I
seem to remeber similat problems in BCB6 when calling Navigate on a new
instance of a derived browser. For me, showing the form first solved the
problem, but this may be unrelated.
Mark |
|
|
| Back to top |
|
 |
Mark Guerrieri Guest
|
Posted: Wed Jul 12, 2006 7:15 pm Post subject: Re: Deriving a control from TCppWebBrowser |
|
|
Make sure the entire form containing the browser control is visible...
"Brad Harding" <bradharding (AT) gmail (DOT) com> wrote in message
news:44af0abb$1 (AT) newsgroups (DOT) borland.com...
| Quote: |
Thanks for your assistance, Mark, but unfortunately it doesn't solve the
problem. Putting "pBrowser->Visible = true" before the Navigate command
doesn't seem to make any difference, and the access violation is still
raised...
Brad.
"Mark Guerrieri" <mguerrieri (AT) no_spam_verizon (DOT) net> wrote:
Try setting Visible to true prior to calling Navigate for the first time.
I
seem to remeber similat problems in BCB6 when calling Navigate on a new
instance of a derived browser. For me, showing the form first solved the
problem, but this may be unrelated.
Mark
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|