🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.web
Article #898

Re: JavaScript Errors (overwrite Exec method)

#898
From: 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.
>
>
Technical Details
Message-ID: <438c9c5a@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <438b55a5@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,84f751fe3ed9d35b
X-Google-Attributes: gidfeeec,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Mark Guerrieri" <mguerrieri@nospam_cmsgrp.com>
Newsgroups: borland.public.cppbuilder.internet.web
References: <438b55a5@newsgroups.borland.com>
Subject: Re: JavaScript Errors (overwrite Exec method)
Date: Tue, 29 Nov 2005 13:23:10 -0500
Lines: 55
Organization: Creative Marketing Strategies
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 209.50.174.82
Message-ID: <438c9c5a@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1133288538 209.50.174.82 (29 Nov 2005 10:22:18 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail