🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TCppWebBrowser locks up

#1336
From: Albert Wiersch
Date: Tue, 22 Feb 2005 17:04
108 lines
3826 bytes
Here is the page:
<html>
<body>
<a href="./">Directory</a>
</body>
</html>

I've traced the lockup to the below function which basically tries to save 
the source document to a file... but there really isn't a source document so 
this must have something to do with it. I will do some more tracing. Any 
ideas would be great... thanks.

int __fastcall TCSEQEForm::AWWBDocumentComplete(TObject *Sender, LPDISPATCH 
pDisp, tagVARIANT *URL, int flags) {

 int retval=0;

 int cf=FALSE; // completely finished loading
 if (WB->Busy) return 2; // shouldn't be busy
 HRESULT hr;
 LPUNKNOWN lpUnknown;
 LPUNKNOWN lpUnknownWB=NULL;
 LPUNKNOWN lpUnknownDC=NULL;

 lpUnknown=WB->ControlInterface;
 if (lpUnknown) {
  hr=lpUnknown->QueryInterface(IID_IUnknown,(LPVOID *)&lpUnknownWB);
  if (SUCCEEDED(hr)) {
   hr=pDisp->QueryInterface(IID_IUnknown,(LPVOID *)&lpUnknownDC);
   if (SUCCEEDED(hr)) {
    if (lpUnknownWB==lpUnknownDC)
     cf=TRUE;
   }
  }
 }

 if (lpUnknownWB) lpUnknownWB->Release();
 if (lpUnknownDC) lpUnknownDC->Release();

 if (!cf) return 1; // not finished

 AnsiString locurl=WB->LocationURL;
 StrStore locurlstrstore=locurl.c_str();
 if (locurl=="") return -3; // how did this happen?
 OpenCombo->Text=locurl; // new 6/13/2000

 int savesuccess=FALSE;
 try {
  AWWBWait(2);
  if ( (WB) && (WB->Document) ) {
   IPersistFile *IpersFile=NULL;
   {
    while (1) {
     HRESULT hr2=WB->Document->QueryInterface(IID_IPersistFile,(void 
**)(&IpersFile));
     if ( (SUCCEEDED(hr2)) && (IpersFile) ) {
      HRESULT 
saveresult=IpersFile->Save(StringToOleStr(p->vol->WBsourcefilename.getString()),false);

      if (saveresult==S_OK) { // 0 is success, non-zero is failure
       savesuccess=TRUE; break;
      }
      else {
       SetStatusBarText("Failed to save web browser source HTML."); // new 
2004-02-09
       if (IpersFile) {
        IpersFile->Release(); IpersFile=NULL;
       }
       WBRefreshBtnClick(Sender); // workaround for problem where pages 
aren't saved successfully (???)
       return retval;
      }
     }
    }
   }
   if (IpersFile) {
    IpersFile->Release(); IpersFile=NULL;
   }
  }
 } catch (...) { }

 return retval;
}
//---------------------------------------------------------------------------

-- 
Albert Wiersch
http://www.htmlvalidator.com/


"Hans Galema" <notused@notused.nl> wrote in message 
news:421b20d1@newsgroups.borland.com...
> Albert Wiersch wrote:
>> If I am viewing a ***local file*** like C:\html\test.html in 
>> TCppWebBrowser with this:
>> <a href="./">test</a>
>>
>> And I click on the "test" link in the browser, it then displays the 
>> contents of the directory, similar to Windows Explorer,
>
> This is an incredible feature.
>
>> but my application locks up.
>
> Mines does not. What else is in that page ?
>
> Hans. 
Technical Details
Message-ID: <421b660a$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <421a69ea$1@newsgroups.borland.com> <421b20d1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,4928ef008d628065
X-Google-Attributes: gidfeeec,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Albert Wiersch" <mrinternetnewsborland@wiersch.com>
Newsgroups: borland.public.cppbuilder.internet.web
References: <421a69ea$1@newsgroups.borland.com> <421b20d1@newsgroups.borland.com>
Subject: Re: TCppWebBrowser locks up
Date: Tue, 22 Feb 2005 11:04:42 -0600
Lines: 110
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 70.244.73.182
Message-ID: <421b660a$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1109091850 70.244.73.182 (22 Feb 2005 09:04:10 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail