|
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)
FWDiscus.zip ( 59.28k )
Number of downloads: 145
|