Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: Cezary Tomczyk Newsgroups: comp.lang.javascript Subject: Re: Refreshing ActiveX controls Date: Fri, 30 Nov 2012 00:27:36 +0100 Organization: Aioe.org NNTP Server Lines: 97 Message-ID: References: <1463591.kyDlKFe50m@PointedEars.de> <34728788.KEVs06lIuy@PointedEars.de> NNTP-Posting-Host: RMrsF+s1qSnxq5Qkkqjnpw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.javascript:17381 W dniu 2012-11-29 23:20, Thomas 'PointedEars' Lahn pisze: > Cezary Tomczyk wrote: > >> Thomas 'PointedEars' Lahn pisze: >>> Cezary Tomczyk wrote: >>>> Any idea how to refresh ActiveX controls without restarting IE? (or >>>> probably any browser that support ActiveX). >>> Several. Depends on what *exactly* you are looking for. >> >> I'll try do describe it how it works in steps: >> >> 1. The user goes to the requested page. Let's say http://www.test.com/ > > There is a real test.com. For examples, please use the .example TLD or the > example.com SLD: > > Or even example.net and example.org. Will use those names next time. > If you have a problem with a Web site, however, it is of course best to post > the real URI. Actually I can not post a real URL, but I am not sure if this could help anything. The main point of the problem is elsewhere. >> 2. I check if user has already installed required external software. >> This software has a specified "ProgID" and ActiveX Class ID. >> >> Short code: >> >> var found, obj; >> >> if (typeof window.ActiveXObject !== 'undefined') { >> try { >> obj = new window.ActiveXObject('here is full ProgID'); >> found = typeof obj !== 'undefined'; > > I do not think `obj' is ever going to be `undefined' at this line. You can > just as well assign `true', or skip `found' and only work with `obj' (which > you might want to initialize with `null'). Not really. I tested in IE9: var obj = new window.ActiveXObject('NonExistsProgID'); window.console.log(typeof obj); The result is: undefined. > See also jsx.net.http.Request.prototype._getXHR() in > > (a bit slow currently). I know that file and I even studied more closely not so long time ago :-) I see your part of initializing XHR object, but there is also some weird parts for me. You define: x = null; and later in part between /*@if (@_jscript_version >= 5) and @end @*/ in catch(e){} you sets x = null, which I do not know why. It is defined x = null at the beginning. Not sure if part for /* IceBrowser */ is still necessary. However, generally speaking code could inspire many coders. >> } catch (e) { >> } >> } >> >> 3. If "found" is true then this means that required external software is >> installed and user will be moved to the next step. If not then I >> triggering download process and must wait for end of installation. >> External software will do all necessary changes inside ActiveX after >> installation is complete. >> >> Now, I check every n seconds (using setTimeout instead of setInterval) >> if required software is already installed. I can not check required >> "ProgID" until I restart manually Internet Explorer. That's the problem. >> >> All I want is to refresh ActiveX list of all Controls and read required >> data from ActiveX (check if required "control" is already installed) >> without restart Internet Explorer. > > You should reconsider that approach. There should be an event for the > successfully loaded ActiveX control which you can add an event listener for, > or the control can execute code itself. Hm, interesting. If you have any links that can explain more about that then I would be glad to get them. In the meantime I will check what Google returns about that. -- Cezary Tomczyk http://www.ctomczyk.pl/