🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.web
2 messages
2 total messages Started by Enrique Mon, 28 Nov 2005 19:08
JavaScript Errors (overwrite Exec method)
#897
Author: Enrique
Date: Mon, 28 Nov 2005 19:08
43 lines
2720 bytes
Hello !
I need help handling JavaScript erros. I've seen the MSDN article:
http://support.microsoft.com/default.aspx?scid=kb;en-us;261003

And I found the next "extra" explanation about how to implement that:

"Basically, you need to implement your own web browser control that
implements IOleCommandTarget.  IOleCommandTarget.Exec will be called with a
Command Group of CGID_DocHostCommandHandler and a Command ID of
OLECMDID_SHOWSCRIPTERROR when an unhandled scripting error is sent to the
browser control.
You can achieve this by deriving a new class that decends from TOleControl
(which already implements IOleCommandTarget) and implementing a virtual
protected Exec there, then creating a new WebBrowser control (or add the
existing one to your project and change it) that derives from your new
TOleControl decendant instead of TOleControl itself.  Override Exec in this
WebBrowser control, and you should be good to go.  This also alows you to
taylor many other WebBrowser related things by tweaking your TOleControl
decendant's implementation of its various interfaces."

The problem is: I don't know how to do it  =(
How can I create a new WebBrowser control that derives from mi new
TOleControl?

I have tried something like this:

class TOleControlMio : public TOleControl
{
 virtual STDMETHODIMP Exec( const GUID* pguidCmdGroup, DWORD nCmdID,
      DWORD nCmdexecopt, VARIANTARG* pvaIn, VARIANTARG* pvaOut );
};

class TCppWebBrowserMio : public TCppWebBrowser, TOleControlMio
{
};

But it gives to me the next error:
"Multiple base classes not supported for Delphi classes"
anyway, I think that it won't work this way.
How can I "overwrite" the Exec method from IOleCommandTarget???

Thanks !
enrique.
Re: JavaScript Errors (overwrite Exec method)
#898
Author: Mark Guerrieri
Date: Tue, 29 Nov 2005 18:23
53 lines
2994 bytes
See my reply in the .ActiveX group...

Mark

"Enrique" <enridp@yahoo.com.ar> wrote in message
news:438b55a5@newsgroups.borland.com...
> Hello !
> I need help handling JavaScript erros. I've seen the MSDN article:
> http://support.microsoft.com/default.aspx?scid=kb;en-us;261003
>
> And I found the next "extra" explanation about how to implement that:
>
> "Basically, you need to implement your own web browser control that
> implements IOleCommandTarget.  IOleCommandTarget.Exec will be called with
a
> Command Group of CGID_DocHostCommandHandler and a Command ID of
> OLECMDID_SHOWSCRIPTERROR when an unhandled scripting error is sent to the
> browser control.
> You can achieve this by deriving a new class that decends from TOleControl
> (which already implements IOleCommandTarget) and implementing a virtual
> protected Exec there, then creating a new WebBrowser control (or add the
> existing one to your project and change it) that derives from your new
> TOleControl decendant instead of TOleControl itself.  Override Exec in
this
> WebBrowser control, and you should be good to go.  This also alows you to
> taylor many other WebBrowser related things by tweaking your TOleControl
> decendant's implementation of its various interfaces."
>
> The problem is: I don't know how to do it  =(
> How can I create a new WebBrowser control that derives from mi new
> TOleControl?
>
> I have tried something like this:
>
> class TOleControlMio : public TOleControl
> {
>  virtual STDMETHODIMP Exec( const GUID* pguidCmdGroup, DWORD nCmdID,
>       DWORD nCmdexecopt, VARIANTARG* pvaIn, VARIANTARG* pvaOut );
> };
>
> class TCppWebBrowserMio : public TCppWebBrowser, TOleControlMio
> {
> };
>
> But it gives to me the next error:
> "Multiple base classes not supported for Delphi classes"
> anyway, I think that it won't work this way.
> How can I "overwrite" the Exec method from IOleCommandTarget???
>
> Thanks !
> enrique.
>
>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads