🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

TCppWebBrowser: Program Crash when OnNewWindow2 is used.

#1179
From: James O'Brien
Date: Fri, 24 Jun 2005 21:44
30 lines
2093 bytes
Hello All,

I'm using OnNewWindow2 event to  force clicked URL to be displayed in 
secondary TCppWebBrowser window, rather than allow the URL to be displayed 
in a new default browser window.  All is working fine, but when the main 
program exits, it crashes during call to destructor of  form containing 
secondary TCppWebBrowser control.  I haven't added code to form's 
descructor.

This only happens after I assign the ppDisp propery of OnNewWindow2 event 
handler.  If I explicitly navigate to a URL using this secondary 
TCppWebBrowser control, when the program exits, there is no crash.

Below is the OnNewWindow2 event handler.


void __fastcall TMainWnd::BROWSE_DisplayNewWindow2(TObject *Sender,
      LPDISPATCH *ppDisp, VARIANT_BOOL *Cancel)
{
   A = "about:blank";  //force display of blank page.
   BrowseWin->ShowHTMLPage(&A, 0, 0);  //function to make form visible and 
display supplied URL
   *ppDisp = BrowseWin->BrowseCtrl->ControlInterface;
}
//---------------------------------------------------------------------------



Thanks for any assistance,
James O'Brien
Technical Details
Message-ID: <42bc7eb3$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!news-in.nuthinbutnews.com!news-in.newsgroups.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,2f26de5706e6acb4,start
X-Google-Attributes: gidfeeec,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "James O'Brien" <obrien@niscnet.com>
From: "James O'Brien" <obrien@niscnet.com>
Newsgroups: borland.public.cppbuilder.internet.web
Subject: TCppWebBrowser: Program Crash when OnNewWindow2 is used.
Date: Fri, 24 Jun 2005 17:44:17 -0400
Lines: 32
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 66.134.39.197
Message-ID: <42bc7eb3$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1119649459 66.134.39.197 (24 Jun 2005 14:44:19 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!news-in.nuthinbutnews.com!news-in.newsgroups.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail