Windows Vista Tips

Windows Vista Tips > Newsgroups > Internet Explorer > HTA problem with IE8

Reply
Thread Tools Display Modes

HTA problem with IE8

 
 
WCHull
Guest
Posts: n/a

 
      06-18-2010
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 = strFunctionNam
strFunctionName = "ADA-CommonFunctions:AppStatusDisplay
if bolAddToStatusLogIn the
AppStatus strMsgI
end i
strAppMessage = strMsgI
set objParent = self.paren
if varType(objParent) = vbObject the
set objMenuFrame = self.parent.document.getElementById("ifrMenuFrame"
set objMsgArea = objMenuFrame.contentWindow.document.getElementById ("divScriptMessage"
els
set objMsgArea = divStatu
end i
objMsgArea.Innertext = strMsgI
call ExecCommand(""
strFunctionName = strCalledFromFunctio
end su


---
frmsrcurl: http://msgroups.net/microsoft.public...lorer.general/
 
Reply With Quote
 
 
 
 
PA Bear [MS MVP]
Guest
Posts: n/a

 
      06-18-2010
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
 
Dan
Guest
Posts: n/a

 
      06-21-2010
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" </> wrote in message
news:...
> 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
 
WCHull
Guest
Posts: n/a

 
      06-22-2010
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 = strFunctionNam
strFunctionName = "ADA-CommonFunctions:AppStatusDisplay
if bolAddToStatusLogIn the
AppStatus strMsgI
end i
strAppMessage = strMsgI
set objMsgArea = divStatu
objMsgArea.Innertext = strMsgI
call ExecCommand(""
strFunctionName = strCalledFromFunctio
end su

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

BB 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
What's wrong with my live.com account? Michael Elliott Windows Live Mail 43 1 Week Ago 09:36 PM
why does my cursor jump all over when I am typing petro Windows Vista Hardware 22 01-15-2011 11:32 AM
Vista32, new driver? & USB Mouse/Keyboard not working Scott J. Stringfellow Windows Vista Hardware 27 04-01-2010 05:22 PM
Cannot install ATI drivers or Catalyst Control Center Pete Russell Windows Vista Performance 9 03-28-2010 02:52 AM
WLM Get faultcode: Windows Live Communication Platform has stoped working Masse Borglund Windows Live Messenger 21 03-28-2010 12:41 AM



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