Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Can you add a custom class in an HTA?

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,32923
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Can you add a custom class in an HTA?
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Can you add a custom class in an HTA? - 4/1/2006 6:57:25 PM   
  Jack in the Box

 

Posts: 6
Score: 0
Joined: 4/1/2006
Status: offline
Hello everybody.

I am creating an HTA file that will be used by to configure DFS on our new servers and I came across DiGiTAL.SkReAM's 'Dynamic Activity Window' script (http://www.visualbasicscript.com/m_32390/tm.htm) that looked to be a god send for updating our admin's as to what the HTA is doing when it running because it can take several minutes to finish when it running.

What I've noticed is when run from a VBS script the DiGiTAL.SkReAM's code works fine but in an HTA I always get an unterminated string constant error at the line "    subBarCat " End Sub".  I'm still very new to scripting and HTA's so I might be completely off base but since I know the code works without issue when run from a VBS file is it safe to assume that the issue is because you  can't add a custom class in an HTA or is there something in particular about this code that will not run in an HTA?  For reference below is the quick test HTA I'm using just to see if the progress bar would display that gets the same string error I get in my DFS HTA.

Cheers,
Chris


      



 
 
Post #: 1
 
 RE: Can you add a custom class in an HTA? - 4/2/2006 12:32:36 AM   
  DiGiTAL.SkReAM


Posts: 1193
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
Heya Chris!

Just so that you know, that code was setup to run from a .vbs file and was never tested in an .hta.  The reason is because it CREATES an .hta file to run from.  So you have an hta trying to create a temporary hta in your test script.
As to how to go about doing this, I just dunno at this point. 
It's 9:30am on Sunday morning here, and I can barely read/type, let alone load text into an editor.

I'll take a look at it later today, and see waht i can find.

_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to Jack in the Box)
 
 
Post #: 2
 
 RE: Can you add a custom class in an HTA? - 4/2/2006 3:54:05 AM   
  Jack in the Box

 

Posts: 6
Score: 0
Joined: 4/1/2006
Status: offline
DiGiTAL.SkReAM,

Thank you for your response.  I knew there was a chance that it would not work from an HTA but more then half the time I've been able to scavenge a useful subroutine or function and have it work from within an HTA without too many issues. 

In this case the bit of code you wrote is the best I've come across for displaying informational messages, or even a simple "Please wait." message.  It would be awesome if it could be run from an HTA but I just don't know enough yet to get it to work despite working on for the better part of Saturday.  Any help you would be willing to provde would be appreciated.

Cheers,
Chris

(in reply to Jack in the Box)
 
 
Post #: 3
 
 RE: Can you add a custom class in an HTA? - 4/2/2006 9:14:21 AM   
  DiGiTAL.SkReAM


Posts: 1193
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
Ok.  I'm a bit better rested now. heh heh.  Have a respectfully large dose of caffeine in my belly and am ready to start messin' wid stuff.
I'll post as I find things...

_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to Jack in the Box)
 
 
Post #: 4
 
 RE: Can you add a custom class in an HTA? - 4/2/2006 1:53:22 PM   
  DiGiTAL.SkReAM


Posts: 1193
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
Ok.  I just had to do my 2005 taxes (personal and for my company).
Due to this trauma, I refuse to do anything that is too close to being work for a period of 8 hours.

Also, since I am not the world's best authority on HTA files, I have no clue as to the answer for your question.  What i *would* suggest is that you craft your master HTA to dynamically create a .vbs file that will run the HTA?  i dunno man.  My brain is all twisty with deaing with the IRS tax code.

You think PERSONAl taxes are a trip, try CORPORATE TAXES for a serious headtrip.

_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to DiGiTAL.SkReAM)
 
 
Post #: 5
 
 RE: Can you add a custom class in an HTA? - 4/2/2006 2:46:53 PM   
  Jack in the Box

 

Posts: 6
Score: 0
Joined: 4/1/2006
Status: offline
I empathize completely with respect to doing taxes and not wanting to look at code.

I'm hardly an authority on HTA's or vbs, I relatively new to both worlds and have only a rudimentary understanding of both to be honest.  I'm not sure if the problem is with the HTA reading the section of your class with HTML code that includes the code between the <script> tags or if it is because HTA's doesn't handle classes properly or if more likely your code has a character that HTML is trying render when it shouldn't, like double quotation marks when you need a Chr(34) - but then you seem to have done that all as far as I can tell.

<sigh>

I'll keep plugging away.  Thanks for looking.

Cheers,
Chris

(in reply to DiGiTAL.SkReAM)
 
 
Post #: 6
 
 RE: Can you add a custom class in an HTA? - 4/2/2006 5:00:16 PM   
  Jack in the Box

 

Posts: 6
Score: 0
Joined: 4/1/2006
Status: offline
It would appear you can add classes to an HTA. 

I found the issue, or at least the one causing the unterminated string constant error.  The HTA was failing with the "<" and ">" characters in the StartBar sub.  Replacing them with Chr(60) and Chr(62) eliminated the error.

Now the "Please Wait" progress bar displays but I can't get it to close.  The oBar.CloseBar doesn't seem to work when run from an HTA.  At least it is progress though.

< Message edited by Jack in the Box -- 4/2/2006 5:19:25 PM >

(in reply to Jack in the Box)
 
 
Post #: 7
 
 RE: Can you add a custom class in an HTA? - 4/2/2006 6:10:22 PM   
  Jack in the Box

 

Posts: 6
Score: 0
Joined: 4/1/2006
Status: offline
Well I'm not sure why but the problem with the progress bar not closing seemed to be because it could not find the .run file to delete it.  What is odd though is if I threw in 'msgbox sProgressBarRunFile' right before  'If oFSO.FileExists(sFileToKill) Then oFSO.DeleteFile sFileToKill, True' in the Sub subKillFile it would show the correct path and once I clicked OK to the msgbox it would then delete the file and the progress bar would close - as expected. When I removed the msgbox command and it was back to using the original code it never seemed to be able to find the run file and so the progress bar would never close.
 
I worked around it by changing the Sub subKillFile to not use an if condition and instead used on error resume next and set the command to simply delete whatever file was provided.  Then instead of passing that sub the name of the run file I simply tell it to delete all *.run files.  That seems to work fine and should be alright.  At least it gaurentees that there are no files left in the temp directory with a .run extension. 
 
Here is an example of the same HTA was using to test it:


      

(in reply to Jack in the Box)
 
 
Post #: 8
 
 RE: Can you add a custom class in an HTA? - 4/3/2006 12:35:33 AM   
  DiGiTAL.SkReAM


Posts: 1193
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
Heya
Ok, I've recovered enough now that i am willing to look at work-like stuff. heheheh
I'm glad that you were able to find the problem.
That delete file thing is weird.



_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to Jack in the Box)
 
 
Post #: 9
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Can you add a custom class in an HTA? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts