Jay Massena and Douglas Hodges
Updated: February 12, 1997
Summary
This document is a step-by-step tutorial for creating the Bgsound design-time control using Microsoft® Visual Basic® version 5.0.
Contents
Step 1: Create ActiveX Control project
Step 2: Use the VB ActiveX Control Interface Wizard to configure your control
Step 3: Add IActiveDesigner interface reference to project
Step 4: Implement IActiveDesigner interface
A. Create new ActiveX control project using File.New Project and choose ActiveX Control at the type.
B. Add label control to the UserControl (ActiveX control) you just created.
C. Set properties on the label control.
Set label control Name property to "lblSource" Set label control Caption property to "[No Sound Source]"
D. Name the project and control.
Project name = web Control name = bgsound
E. Save the project and name the project file "web.vbp"; name the control file "bgsound.ctl."
A. Use the Add-Ins.ActiveX Control Interface Wizard to launch the wizard.
B. Remove default events, props, and methods that have been added.
C. Add the following properties. (Note: Repeat is used instead of Loop because Loop is a VB keyword)
Source Repeat
D. Point the Source property to lblSource.Caption property.
E. Set the Repeat datatype to integer and the default to -1.
F. Finish wizard.
A. Add reference to the "Microsoft Web Design-time Control Type Library."
Open Project.References and scan the list of available references making sure that the Microsoft Web Design-time Control Type Library is checked if present. If the library is not listed, then browse to the c:\program files\design-time control sdk\samples\vb\common directory (if you used the default install location) and add webdc.tlb as a project type reference. This automatically checks the library in Project.References and includes it in your project.
A. Add IProvideRuntimeText interface definition
Implements IProvideRuntimeText
B. Implement IProvideRuntimeText_GetRuntimeText
Dim strText As String Dim strQuote As String strQuote = Chr$(34) strText = "<BGSOUND SRC=" & strQuote & lblSource.Caption & strQuote strText = strText & " LOOP=" & strQuote & Repeat & strQuote & ">" IProvideRuntimeText_GetRuntimeText = strText
C. Compile web.ocx