Microsoft Windows Vista Community Forums - Vistaheads
Recommended Download



Welcome to the Microsoft Windows Vista Community Forums - Vistaheads, YOUR Largest Resource for Windows Vista related information.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so , join our community today!

If you have any problems with the registration process or your account login, please contact us.

Driver Scanner

HTA problem with IE8

microsoft.public.internetexplorer.general






Speedup My PC
Reply
  #1 (permalink)  
Old 06-18-2010
WCHull
 

Posts: n/a
HTA problem with IE8
We discovered an issue with some inbedded VBScript code inside an HTA written by a developer that is no longer with us. The code work in IE6 but error out on the set objMsgArea statement indicating that the object requires 'objMenuFrame' which should have been set in the previous line of code. If I put in an 'On Error Resume Next" statement in that sub the HTA appears to work correctly however I don't like putting a band-aid on something like this. Does anyone have any solution for this? Here's the code:

sub AppStatusDisplay(strMsgIn, bolAddToStatusLogIn)
strCalledFromFunction = strFunctionName
strFunctionName = "ADA-CommonFunctions:AppStatusDisplay"
if bolAddToStatusLogIn then
AppStatus strMsgIn
end if
strAppMessage = strMsgIn
set objParent = self.parent
if varType(objParent) = vbObject then
set objMenuFrame = self.parent.document.getElementById("ifrMenuFrame" )
set objMsgArea = objMenuFrame.contentWindow.document.getElementById ("divScriptMessage")
else
set objMsgArea = divStatus
end if
objMsgArea.Innertext = strMsgIn
call ExecCommand("")
strFunctionName = strCalledFromFunction
end sub


---
frmsrcurl: http://msgroups.net/microsoft.public...lorer.general/
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-18-2010
PA Bear [MS MVP]
 

Posts: n/a
Re: HTA problem with IE8
Looks like you may be hiring a new Developer.

Developer-specific resources include:

MSDN IE Development Forum (post such questions here instead)
http://social.msdn.microsoft.com/For...opment/threads

Tip: When posting in Developer forums, always include a link to your web
site or test pages in your first post.

IE Developer Center
http://msdn.microsoft.com/en-us/ie/default.aspx

Learn IE8
http://msdn.microsoft.com/en-us/ie/aa740473.aspx

HTML and DHTML Overviews and Tutorials
http://msdn.microsoft.com/en-us/library/ms537623.aspx and

Cascading Style Sheets (CSS)
http://msdn2.microsoft.com/en-us/ie/aa740476.aspx

Expression Web SuperPreview for Internet Explorer (free, stand-alone visual
debugging tool for IE6, IE7, and IE8)
http://www.microsoft.com/downloads/d...b-dccff3fae677

Expression Web SuperPreview Release Notes
http://www.microsoft.com/expression/...easeNotes.aspx

Validators:
http://validator.w3.org/
http://jigsaw.w3.org/css-validator/


WCHull wrote:
> We discovered an issue with some inbedded VBScript code inside an HTA
> written by a developer that is no longer with us. The code work in IE6
> but
> error out on the set objMsgArea statement indicating that the object
> requires 'objMenuFrame' which should have been set in the previous line of
> code. If I put in an 'On Error Resume Next" statement in that sub the HTA
> appears to work correctly however I don't like putting a band-aid on
> something like this. Does anyone have any solution for this? Here's the
> code:
>
> sub AppStatusDisplay(strMsgIn, bolAddToStatusLogIn)
> strCalledFromFunction = strFunctionName
> strFunctionName = "ADA-CommonFunctions:AppStatusDisplay"
> if bolAddToStatusLogIn then
> AppStatus strMsgIn
> end if
> strAppMessage = strMsgIn
> set objParent = self.parent
> if varType(objParent) = vbObject then
> set objMenuFrame =
> self.parent.document.getElementById("ifrMenuFrame" )
> set objMsgArea =
> objMenuFrame.contentWindow.document.getElementById ("divScriptMessage")
> else set objMsgArea = divStatus
> end if
> objMsgArea.Innertext = strMsgIn
> call ExecCommand("")
> strFunctionName = strCalledFromFunction
> end sub
>
>
> ---
> frmsrcurl: http://msgroups.net/microsoft.public...lorer.general/


Reply With Quote
  #3 (permalink)  
Old 06-21-2010
Dan
 

Posts: n/a
Re: HTA problem with IE8
The error would suggest that objMenuFrame is not being assigned to an
IFRAME. This is probably down to cross frame security improvements in IE8
preventing this from working, and because you're not checking that
objMenuFrame has the appropriate properties before attempting to use them
you are getting the error. On Error Resume Next won't make this work, it'll
just simply skip that line and any others following that error - so the
divScriptMessage element won't be set to the strMsgIn value.

If you add code to print the value of the error number and description after
the "set objMsgArea = ..." line, what are the values displayed? This will
give you a clue to the source of the problem.

contentWindow is an old IE specific reference, have you tried
contentDocument? This a DOM reference so will be supported by IE8, but not
necessarily by earlier versions.

Where are the HTA files being loaded? If in the My Computer zone then you
will need to add a "mark of the web", as IE8 restricts access via scripting
and contentWindow/contentDocument are amongst the properties that have had
security restrictions applied, but it should work if the file is loaded from
the Internet zone.

And why are you calling ExecCommand with an empty string?

Dan

"WCHull" <user@msgroups.net/> wrote in message
news:O4hjxtwDLHA.420@TK2MSFTNGP02.phx.gbl...
> We discovered an issue with some inbedded VBScript code inside an HTA
> written by a developer that is no longer with us. The code work in IE6
> but error out on the set objMsgArea statement indicating that the object
> requires 'objMenuFrame' which should have been set in the previous line of
> code. If I put in an 'On Error Resume Next" statement in that sub the HTA
> appears to work correctly however I don't like putting a band-aid on
> something like this. Does anyone have any solution for this? Here's the
> code:
>
> sub AppStatusDisplay(strMsgIn, bolAddToStatusLogIn)
> strCalledFromFunction = strFunctionName
> strFunctionName = "ADA-CommonFunctions:AppStatusDisplay"
> if bolAddToStatusLogIn then
> AppStatus strMsgIn
> end if
> strAppMessage = strMsgIn
> set objParent = self.parent
> if varType(objParent) = vbObject then
> set objMenuFrame =
> self.parent.document.getElementById("ifrMenuFrame" )
> set objMsgArea =
> objMenuFrame.contentWindow.document.getElementById ("divScriptMessage")
> else
> set objMsgArea = divStatus
> end if
> objMsgArea.Innertext = strMsgIn
> call ExecCommand("")
> strFunctionName = strCalledFromFunction
> end sub
>
>
> ---
> frmsrcurl: http://msgroups.net/microsoft.public...lorer.general/




Reply With Quote
  #4 (permalink)  
Old 06-22-2010
WCHull
 

Posts: n/a
Re: HTA problem with IE8
Thanks for the reply.

I know this doesn't really solve the problem referenced in the origional post however the sub has been re-written to be as follow:

sub AppStatusDisplay(strMsgIn, bolAddToStatusLogIn)
strCalledFromFunction = strFunctionName
strFunctionName = "ADA-CommonFunctions:AppStatusDisplay"
if bolAddToStatusLogIn then
AppStatus strMsgIn
end if
strAppMessage = strMsgIn
set objMsgArea = divStatus
objMsgArea.Innertext = strMsgIn
call ExecCommand("")
strFunctionName = strCalledFromFunction
end sub

We determined that the original sub had some "extraneous code" in this subroutine that was not really needed by any of the HTA's that used that routine thus is was easier just to remove the code that was causing the error.

---
frmsrcurl: http://msgroups.net/microsoft.public...oblem-with-IE8
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
the problem with ndis.sys Blue Screen of Death problem solved? liketofindoutwhy microsoft.public.windows.vista.general 6 05-24-2009 14:53
Re: Windows Mail Attachement Problem and Adobe Player Problem with IE8 Rainald Taesler microsoft.public.windows.vista.mail 15 05-17-2009 07:11
IE7 Freezes Randomly, Using Vista Ultimate 64-bit + Home Page Load Problem + IE 64-bit Flash Player Problem Susan microsoft.public.internetexplorer.general 6 01-22-2009 02:34
Multi-select problem in Windows Explorer BIG PROBLEM!!!!!! =?Utf-8?B?SmltIEhhbnNlbg==?= microsoft.public.windows.vista.general 3 12-17-2007 03:09
Generic McAfee Problem Message in Vista Problem Reports cyberbuff53 microsoft.public.windows.vista.performance maintenance 0 12-01-2007 14:55




All times are GMT +1. The time now is 05:49.




Driver Scanner - Free Scan Now

Vistaheads.com is part of the Heads Network. See also XPHeads.com , Win7Heads.com and Win8Heads.com.


Design by Vjacheslav Trushkin for phpBBStyles.com.
Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.0 RC 2

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