| the complete webmaster | ||||
| tutorials | reviews | reference | ||
|
Using ActiveX controls with FrontPage 98 #1: The HHCtrl controlActiveX Controls are small Windows programs that carry out a variety of tasks. The Controls can be used as components of larger programs - such as those written in Visual Basic or Visual C++. As such, they save programmers a lot of time (and hence money) since routines can be slotted into a program without having to write that part of the program from scratch. The good thing about ActiveX Controls is that they can also be incorporated into web pages. Unfortunately they only work in Windows versions of Internet Explorer, so you should ensure you have an alternative on your web page (although if you are working on an Intranet site accessed exclusively by Internet Explorer 4 you don't need to worry about this too much). This first article in a new series looks at the HHCtrl ActiveX Control. This Control is supplied with Internet Explorer 4 and various other new Microsoft products. It is the ActiveX Control responsible for powering the new HTML Help system found in Windows 98, Internet Information Server 4 and many other new Windows products. Conveniently, this Control can also be used on a web page to provide a neat tree of the web site... Where to find the tools required
How to use the ControlThere are two parts to using the Control:
Creating a site indexStart the HTML Help Workshop (usually installed on the Start menu under Programs|HTML Help Workshop) and select the menu command File|New, then Table of Contents. Add some entries to this table of contents to make your site map. This site map should
be arranged in a hierarchical fashion, i.e. like a traditional windows help file. Of
course, you might like to base your design on the navigation view of your FrontPage web.
New headings are added by the second button of the side toolbar (
After adding some headings, add some pages to the table of contents by clicking on the
third button in the toolbar ( Use the menu command File|Save File to save the file you have created into your FrontPage web. The file will be given a .hhc file extension. Double-clicking on this file in the FrontPage web will normally load the file back into HTML Help Workshop. Power users can right click on it and open the file in Notepad to tweak the HTML in the file. Extreme power users will be clever enough to figure out how to create an automatically generated table of contents for their site! There are also lots of other neat things you can also do with HTML help files, like changing the appearance of the icons. Adding the ActiveX Control to the web pageLoad FrontPage and open the page to contain the Control. Tip: if you are going to use the Control on your site I would recommend placing it on its own frame on the left hand side of the screen. Use the menu command Insert|Advanced|ActiveX Control. In the Pick a Control field of the ActiveX Control Properties window select the HHCtrl Object. Give it a Name (e.g. hhctrl1), and appropriate Width and Height (e.g. 250 by 200 pixels) and an Alternative Representation for browsers that don't support ActiveX. Having done this, click on the Properties button to open the Object Parameters window. This window should be used to add new parameters to the ActiveX Control. To add the first set, click on the Add button in this window, then enter the following in the Edit Object Parameter window: The Name field should contain the word Command, and Data radio button should be checked, with the word Contents inserted into the field next to the radio button. After this is done, a second object parameter should be added, this time with the word Item1 in the Name field, and the path and filename of your .hhc file in the field next to the Data radio button. The final settings in the Object Parameters window should then match those below:
Out of interest, the HTML code inserted by this method is below: <object id="hhctrl1" border="0" width="250" height="200" classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11"> <param name="command" value="contents"> <param name="item1" value="051498.hhc">ActiveX navigation tool</object> Having done this, you can then test your new ActiveX Control:
Note that this menu will normally only work in Internet Explorer 4 (although it should work on Internet Explorer 3 if the appropriate Control is installed). To be on the safe side, I always use the browser detection feature of Internet Information Server to ensure that the ActiveX Control only appears if the client machine is running IE4. Out of interest, while using this ActiveX Control, FrontPage will often complain with an error message No command was specified for HHCtrl. You can safely ignore this message. Don't forget to make sure your new navigation feature works though - the ActiveX Control will work in the FrontPage preview mode. Incidentally, the HTML Help Workshop also comes with a Java Applet for providing non-Microsoft browsers with the ability to view HTML Help files, but the use of this is beyond the scope of this article. Author: Brett Burridge More articles about FrontPage |
| write for us | about us | advertise |
Copyright 1997, 1998 A Big Lime. All rights reserved.