[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

10/31/2009 at 04:21AM PDT, ID: 24860544 | Points: 500
[x]
Attachment Details

The interface is unknown

Asked by tomandlis in JavaScript, Internet Explorer Web Browser, ActiveX

Tags: javascript activex internet explorer

IE8 has broke with IE7 somehow regarding javascript and activex and I'd like someone to tell me how to fix the following errors (they are all related somehow).  The errors come from using the javascript code shown at bottom.  To reproduce the problem just create an html page to your development environment add the dev site and target site to your 'trusted sites' in IE.  I used espn.go.com as the target site, but any site will work.  If you run the code below in IE7/IE6 it will work fine.  In IE8 it bombs with the errors below.

Message: The interface is unknown.
Message: The object invoked has disconnected from its clients.

I found a couple of links that describe similar issue:

http://codingforums.com/archive/index.php?t-10531.html
http://base.thep.lu.se/ticket/1363
http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Controls/Q_24026006.html?first=true
http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/2946c583-448f-4c0a-a5fd-3e380256efbb
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
<html>
<head>
<script type="text/javascript">
var READYSTATE_COMPLETE = 4;
var READYSTATE_INTERACTIVE = 3;
var READYSTATE_LOADED = 2;
 
function myStart(){
	var submitwindow = new scraper();
	//submitwindow.timer = new Timer(submitwindow);
	//submitwindow.tick();
}
function scraper(){
	var x="yada";
	this.oBrowser.navigate("http://www.espn.go.com");
	this.timer = new Timer(this);	
	var hardpause = true;
	this.tick(1, hardpause);
}
scraper.prototype.oBrowser = new ActiveXObject("InternetExplorer.Application");
scraper.prototype.oBrowser.Visible = true;
scraper.prototype.resumeAt=30;
scraper.prototype.count = 0;
//	scraper.prototype.timer = new Timer(this);
scraper.prototype.oBrowser.Width = 320;
scraper.prototype.oBrowser.Height = 800;
scraper.prototype.oBrowser.Left = 650;
scraper.prototype.oBrowser.Top = 5;
scraper.prototype.oBrowser.menubar = true;
scraper.prototype.oBrowser.toolbar = true;
scraper.prototype.oBrowser.statusbar = true;
scraper.prototype.oBrowser.Visible = true;
scraper.prototype.oBrowser.Silent = true;
scraper.prototype.step = -1;
scraper.prototype.steps = -1;
//scraper.prototype.sixml = new ActiveXObject("MSXML2.DOMDocument.3.0");
scraper.prototype.lastKnownUrl = "nowhere yet"; 
scraper.prototype.async = false;
scraper.prototype.sep = "--";
scraper.prototype.exit = false;
scraper.prototype.scrapedata = "";
scraper.prototype.nestedLevel=0;
//2004-04-23 mcd added missing 'prototype' below
scraper.prototype.skip=false;
scraper.prototype.soapdocPreBound = "";
scraper.prototype.passedin = false;
scraper.prototype.actionStartTime = "";
scraper.prototype.tick = function(d){
	var argv = this.tick.arguments;
	var argc = argv.length;
	var hardpause = false;
	for (var arg = 0; arg < argc; arg++) {
		//instructionProgress.value =  instructionProgress.value + "<br>Argument " + arg + " = " + argv[arg];
		switch(arg){
			case 1:
				hardpause = argv[arg];
				break;
			default:
				break;
		}
	}
	//instructionProgress.value = instructionProgress.value + "<br>hardpause = " + hardpause;
	this.count+=d;
	var debugmsg=""+this.count + " of " + this.resumeAt + ", readystate=" + this.oBrowser.readyState + ", busy=" + this.oBrowser.Busy + ", outernode no: " + this.step;
	window.status = debugmsg;
	if(this.oBrowser.readyState==READYSTATE_COMPLETE && !(this.oBrowser.Busy) && !(hardpause)) {
		this.step = this.step+1;
		alert('done');
	}
	else {
		
		//alert(this.count < this.resumeAt);
		if (this.count < this.resumeAt) {
			//alert('dude');
			//2009-10-22: the ie8 bug comes somewhere from below in this else clauses
			this.timer.setTimeout("tick", 1000, d, hardpause);
		} 
		else {
			if(!(hardpause)){
			    var currentLocation = this.lastKnownUrl;
                var currentTime = new Date();
                var theTime = currentTime.getHours() + ':' + currentTime.getMinutes() + ':' + currentTime.getSeconds() + ' ';
				var scrapeErrors = "current location: " + currentLocation + "\n  current time:" + theTime + "\n  Action didn't succeed in the time alotted.\n\n";
				this.skip = true;
				this.exit = true;
			} else {
				var instructionProgress= this.sep + "Completed hard pause.\n";
			}
			this.step = this.step+1;
		}
	}
}
 
 
function Timer(){
	this.obj = (arguments.length)?arguments[0]:window;
	return this;
}
 
// The set functions should be called with:
// - The name of the object method (as a string) (required)
// - The millisecond delay (required)
// - Any number of extra arguments, which will all be
// passed to the method when it is evaluated.
//
 
Timer.prototype.setInterval = function(func, msec){
	var i = Timer.getNew();
	var t = Timer.buildCall(this.obj, i, arguments);
	Timer.set[i].timer = window.setInterval(t,msec);
	return i;
}
Timer.prototype.setTimeout = function(func, msec){
	var i = Timer.getNew();
	Timer.buildCall(this.obj, i, arguments);
	Timer.set[i].timer = window.setTimeout("Timer.callOnce("+i+");",msec);
	return i;
}
 
// The clear functions should be called with
// the return value from the equivalent set function.
Timer.prototype.clearInterval = function(i){
	if(!Timer.set[i]) return;
	window.clearInterval(Timer.set[i].timer);
	Timer.set[i] = null;
}
Timer.prototype.clearTimeout = function(i){
	if(!Timer.set[i]) return;
	window.clearTimeout(Timer.set[i].timer);
	Timer.set[i] = null;
}
 
// Private data
 
Timer.set = new Array();
Timer.buildCall = function(obj, i, args){
	var t = "";
	Timer.set[i] = new Array();
	if(obj != window){
		Timer.set[i].obj = obj;
		t = "Timer.set["+i+"].obj.";
	}
	t += args[0]+"(";
	if(args.length > 2){
		Timer.set[i][0] = args[2];
		t += "Timer.set["+i+"][0]";
		for(var j=1; (j+2)<args.length; j++){
			Timer.set[i][j] = args[j+2];
			t += ", Timer.set["+i+"]["+j+"]";
		}
	}
	t += ");";
	Timer.set[i].call = t;
	return t;
}
Timer.callOnce = function(i){
	if(!Timer.set[i]) return;
	//alert(Timer.set[i].call);
	eval(Timer.set[i].call);
	Timer.set[i] = null;
}
Timer.getNew = function(){
	var i = 0;
	while(Timer.set[i]) i++;
	return i;
}
</script>
</head>
<body onload="myStart();">
dude xx
</body>
</html>
[+][-]10/31/09 04:40 AM, ID: 25709277

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/31/09 05:35 AM, ID: 25709478

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/31/09 05:40 AM, ID: 25709498

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/31/09 06:57 AM, ID: 25709798

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/31/09 06:58 AM, ID: 25709810

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/31/09 07:39 AM, ID: 25709957

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/31/09 07:40 AM, ID: 25709959

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/01/09 05:10 AM, ID: 25713605

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/01/09 05:19 AM, ID: 25713619

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/01/09 06:36 AM, ID: 25713797

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/01/09 06:43 AM, ID: 25713821

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/02/09 01:58 AM, ID: 25718149

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/05/09 07:51 AM, ID: 25750755

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/06/09 01:04 AM, ID: 25757654

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20090824-EE-VQP-74 - Hierarchy / EE_QW_3_20080625