Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 131,522 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,972 people online right now. Registration is fast and FREE... Join Now!




Html Applications

 
Reply to this topicStart new topic

Html Applications, Anyone else into this?

dilettante
post 26 Feb, 2005 - 10:05 PM
Post #1


New D.I.C Head

*
Joined: 26 Jan, 2005
Posts: 9



Thanked 2 times
My Contributions


Blah, blah, blah

I posted this here because I consider it a VBScript topic even though it is based 100% on browser technology. Not web server technology (necessarily) but specifically Internet Explorer itself.

You'll find no ASP here, so it doesn't fit that topic area well. No Javascript either, though this can be implemented using IE's JScript as well as VBScript (if you like that sort of thing).

This site doesn't have a VBScript topic area (yet) or I'd try there. One problem with VBScript is people tend to pigeonhole it. They either see it as tied to ASP technology or as WSH scripts. The latter seems to attract a lot of non-programmers (admins) who are looking for code to help them to administer machines.

No, the topic here is building applications in VBScript. In particular the topic at hand here is building HTML Applications (HTAs) in VBScript.

I'll even narrow it further to building "web applications" without a web server as HTAs.

Technology

The core technology here is "Dynamic HTML" (or DHTML). One thing a VB programmer has got to love about IE is that it supports an event binding model very similar to the one VB uses for forms and controls. If you create the HTML for a page with a button on it called cmdFred you can write a click event handler as:

Sub cmdFred_onclick()
:
End Sub


None of that namby-pamby Javascript crap of having to embed inline event handler calls in element tags. But you can do that too where it makes sense.

IE even supports a form of control array! Just give several elements the same ID attribute, you've got a control array. It's actually a collection but that's close enough for our purposes.

Example

You can find some fundamentals of HTA development at MSDN, but there is a dearth of cool examples. There are two basic approaches to HTA user interface design. One results in something VB-form-like, and the other is more web-like.

Consider the Windows Add/Remove Programs applet. Guess what? The thing is an HTA!

Here I'm attaching a simple example I built to have a "webbish" user interface.

Scenario:

You are trying to collaborate with a small group of people at work. You have a LAN with network shares, but no web servers. Maybe you have web servers, but you aren't in a position to deploy random applications on them. If you run a web server on your desktop big brother will come and cut your hands off. Yet surely there is something better to use than emailing each other constantly and copying each other on everything?

All you want is a simple BBS sort of thing. Maybe something light, with zero installation required, and maybe even something where you can easily zip everything up and store it for future reference after the current project is finished. Something... serverless.

Call it "the WordPad of discussion boards" or maybe a "Feather Weight" discussion board?


Requirements, Trying it out

All this sample requires is that everyone have Windows PCs (95B or later) with IE (5.5 or later) and access to a common network share they all have read/write permission to. You just create some folder on that share and unzip the attached file into it, then double-click FWDiscus.hta and you are off to the races. Maybe even read FWDiscusDoc.htm first if you are patient. It contains a few simple tips.

To try it out "solo" just unzip it into a local hard drive folder.

In conclusion

I'd like to see what you think. I see VBScript HTAs as another tool for the VB developer, but a sadly neglected one. What sorts of things can you think of to build this way? Don't forget you can extend the VBScript with VB5/6 ActiveX controls too ("Yes Virginia, there is a way to create stand-alone applications using the free VB5 CCE from Microsoft").

Keep in mind that this is the essence of the upcoming Avalon techology to be released with Longhorn. Avalon is "DHTML Reloaded" in a very real sense.


P.S.

You can extend this application slightly by downloading JETCOMP.exe from Microsoft and putting it in the <span style='font-family:Courier'>Resources
subfolder within the folder you unzip FWDiscus into. You then flip two .vbs files you'll find in Resources and finally uncomment a block of HTML inside FWDiscus.hta itself (just open it with NotePad or something).[/font]

There are some details on this in the comment block, which is near the very end of the file.

This post has been edited by dilettante: 6 Apr, 2005 - 01:10 PM


Attached File(s)
Attached File  FWDiscus.zip ( 59.28k ) Number of downloads: 145
User is offlineProfile CardPM

Go to the top of the page


Amadeus
post 27 Feb, 2005 - 07:11 AM
Post #2


g++ -o drink whiskey.cpp

Group Icon
Joined: 12 Jul, 2002
Posts: 12,158



Thanked 31 times

Dream Kudos: 25
My Contributions


Building HTAs with VBScript is certainly an excellent application of a much maligned (unfairly) scripting language. I used to write a great deal in VBScript, mostly ASP web applications, but some HTAs as well. I always ejoyed it because it is a very simple language, and had little overhead.

The problem now, as then, with VBScript is support - specifically cross platform and to some extent cross browser. It's not that great. Don't get me wrong, I'll always be able to write in VBScript, especially when I deem it the best way to go, but even Microsoft themselves have been paring back support for VBScript, as evidenced with the .NET Framework. M$ had more than one chance to develop .NET support for VBScript, both for web and platform programming, even commisiioned a feasibility study on the subject, but through all releases to date of the .NET framework have refused to add that support.

I do see the advantage to running HTAs in one sense: An HTA is automatically classified as a trusted application, so you can avoid all those IE warnings generated by htm pages dealing with IEs security problems.

I'm not sure what the future for VBScript is, I hope it's bright, because the language is good in a variety of ways. If M$ has a plan for it, I've not seen it yet. I'm hoping for the best, however.
User is offlineProfile CardPM

Go to the top of the page

dilettante
post 27 Feb, 2005 - 02:29 PM
Post #3


New D.I.C Head

*
Joined: 26 Jan, 2005
Posts: 9



Thanked 2 times
My Contributions


VBScript will die someday, but not soon.

Mozilla browsers of course support an HTA-like thing themselves (XUL) but I don't care for it. You can get used to anything if you have to though, so maybe I'll need to give it another try.

The "future" HTA technology from Microsoft appears to be XAML (Avalon) but I don't see any VBScript support because VBScript was killed in .Net, you'll need to use the VB.Net instead. Once again though, you can learn to put up with nearly anything.

This post has been edited by dilettante: 6 Apr, 2005 - 01:13 PM
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/20/08 01:10AM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month