VanDyke Software Forums

VanDyke Software Forums (https://forums.vandyke.com/index.php)
-   Scripting (https://forums.vandyke.com/forumdisplay.php?f=14)
-   -   Windows 10 Internet Explorer ActiveX Failing (https://forums.vandyke.com/showthread.php?t=12998)

mschaafs 02-01-2018 11:02 AM

Windows 10 Internet Explorer ActiveX Failing
 
Good day! I have someone trying to run my SecureCRT/Javascript application on their Windows 10 machine with IE 11 and it is not running properly. The ActiveXObject that is working perfectly on my Windows 7 IE 11 platform.

Code:

//Get a reference to IE's Application object
var g_objIE = new ActiveXObject("InternetExplorer.Application");
g_objIE.Offline = true;
g_objIE.navigate("Title of the Application");

//This loop is required to allow the IE object to finish loading...
while(g_objIE.Busy){
  crt.Sleep(100); 
}
       
var htmlFile = "_Dialog_Template.html";
var newDomDoc = ReplaceData(ReadFileG(htmlFile));  // Get html content
g_objIE.document.write(newDomDoc);

When the navigate command is being called, it is causing Windows to pop up a dialog for downloading an app (go to the app store). When I take that line out, it is failing on the document.write line with a non-descriptive "Error".

I have made sure ActiveX was enabled in the security settings in IE as well as checking the box to allow local active content to run on my computer. I have tried throwing in some hard coded simple html in the write command... none of which worked. Please help as there doesn't seem to be jack online about this issue either.

Thank you!

mschaafs 02-01-2018 11:40 AM

DialogBox Timeout
 
Actually, if possible... is there a way to have a MessageBox timeout? Close after a specified period if not confirmed? Then I can do away with IE and ActiveX in my app.

bstedh 02-01-2018 12:08 PM

objShell.Popup(strText,[nSecondsToWait],[strTitle],[nType])

bgagnon 02-01-2018 01:51 PM

Hi mschaafs,

I did not get the same results as your colleague was getting. I wonder if it has to do with Windows 10 preferring Edge, but that's sort of outside the scope of SecureCRT support, so I will leave that part of it to the community. :)

Since I don't have the complete script, I could not see where you would make use of MessageBox() with a timeout. Please elaborate. Maybe there's a currently available alternative.

mschaafs 02-02-2018 08:46 AM

Windows Shell (wsh) Popup!
 
Good day! Thank you bstedh and Brenda for your responses!

Indeed bstedh's response was exactly what I needed... Utilizing Windows Shell instead of IE is perfect for this app. I am super grateful.

I found good info on it here: http://4umi.com/web/javascript/shell.php

And ended up ditching that block of code for:

Code:

    function TimedDialog(tdTimer, tdMessage, tdTitle){
        var wsh = new ActiveXObject('WScript.Shell');
        popup = wsh.Popup( tdMessage, tdTimer, tdTitle, 64 );       
    }


bgagnon 02-02-2018 11:21 AM

Hi mschaafs,

Excellent, I am glad to hear you were able to incorporate bstedh's idea into your script!

Thanks for the suggestion bstedh!


All times are GMT -6. The time now is 07:54 AM.