Creating Custom FrontPage Component Libraries

Windows Systems

On Windows NT and Windows 95 systems, you can create a custom FrontPage component DLL using C or C++ with Microsoft Visual C++ (32-bit). Perform the following steps:

  1. Create a directory called bots to the main directory for FrontPage. By default this should be “C:\Program Files\Microsoft FrontPage”. This will make the new component available to all FrontPage webs hosted on your machine.

  2. Copy the contents of the WebBots directory from the FrontPage SDK distribution into bots directory for FrontPage. All of your custom component project directories should be inside the bots directory.

  3. Start Microsoft Visual C++. From the File menu, choose the New option, and select Project Workspace. From the New Project Workspace dialog, choose the Dynamic-Link Library option. Press the Browse button next to the Location field, and select the bots directory under the main FrontPage directory. Put your new component’s shortname (botname) in the Project Name field and press Create.

  4. Open a C++ source file from one of the component examples, such as wbtest2.cpp, and save it into your project as botname.cpp. You may need to use the Insert: Files into Project option. Modify the source so it uses the shortname for your component.

  5. Select the Win32 Release target from the drop-down menu on the toolbar. Open the Build Settings property sheet. Go to the Link tab. Change the Output file name from Release/botname.dll to botname.dll. Now use the menu option Build botname.dll.

  6. Create the component description file (botname.inf) and the component template file (botname.htm), using the earlier SDK examples as a guide.

  7. From the FrontPage Explorer’s Tools menu, choose Recalculate Hyperlinks. Your component should now show up in the FrontPage Editor’s Insert : FrontPage Component dialog.

UNIX Systems

On most UNIX systems, you can build a shared dynamically loadable library using C or C++ with the vendor’s compiler or with the GNU C Compiler (gcc). Often the most difficult problem is figuring out the correct flags to pass to the compiler and linker. For example, on Solaris, your Makefile should add the flag “-PIC” to the CFLAGS variable and the flags “-nostdlib -shared” to the LDFLAGS variable. Some compilers may require you to translate the newline characters in webbot.h to the UNIX convention of “\n” (LF) instead of “\r\n” (CR-LF).