🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: IE7 Navigate failing inside a thread

#501
From: Remy Lebeau (TeamB)
Date: Wed, 08 Nov 2006 20:12
28 lines
1971 bytes
"Tom" <tom@nospam.net> wrote in message
news:454f924b$1@newsgroups.borland.com...

> if I change it so that when the button is clicked a thread is
> spawned and that thread makes the exact same call as above

You can't do that.  The Browser can only be accessed in the context of the
thread that created it.  You cannot access it across thread boundaries
(without manually marshalling the ActiveX interface, which can get ugly).

> IE6 and below function just fine.

I seriously doubt that.  IE's ActiveX objects are Apartment-threaded.
Creating them in the main thread, and then accessing them in a worker
thread, should be causing RPC_E_WRONG_THREAD errors to be reported on all
interface methods that are called.

> The alternate solution would be to use Indy to retrieve the source
> code (which is all I'm doing) but even after setting the UA some sites
> still know it's not a web browser and reject the request.

The UserAgent is the only application-specified identifer available.  If you
set Indy's UserAgent to match IE's, there is no other way a website can
differentiate between the two.


Gambit
Technical Details
Message-ID: <45523b17$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <454f924b$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,8c9cd506b6ec73e9
X-Google-Attributes: gidfeeec,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.internet.web
References: <454f924b$1@newsgroups.borland.com>
Subject: Re: IE7 Navigate failing inside a thread
Date: Wed, 8 Nov 2006 12:12:54 -0800
Lines: 30
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 69.169.4.232
Message-ID: <45523b17$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1163016983 69.169.4.232 (8 Nov 2006 12:16:23 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail