Edit ActiveX Server Wizard — Edit ActiveX Property Panel
Use the Edit ActiveX Property dialog box to edit a property in your ActiveX interface. ActiveX properties are similar to user interface control attributes in that attributes belong to a particular control, and different types of controls have different sets of attributes.
You can set the following options:
- Name—The name of your property. The property name must be a valid C identifier and must be less than 50 ASCII characters in length.
- DISPID—The DISPID of your property. The dispid must be a unique positive integer. The DISPID is required for Dispatch, Dual, and Event interface properties.
- Help String—The help string for this property. LabWindows/CVI stores this string in your server's type library.
- Help Context—If you specified a help file for your server, enter the context ID for this property's help information. LabWindows/CVI stores the help context ID in your server's type library.
- Dimension—Select a dimension to fully specify the property type. This tool does not support arrays of interface pointers, including IUnknown* and IDispatch*.
- Add Index Argument—Adds a long integer argument to your property accessor functions. You can use a property with an index argument to represent collections, with the index argument acting like the index in the collection. For example, in an ActiveX interface that represents DAQ hardware, you can use a property to represent the collection of DAQ channels. You can use the index argument in the property functions to identify a particular channel. This is especially useful when the hardware has a large number of channels, in which case exposing each channel with a separate property is inconvenient.
- Type—Select the automation type of the property. If your argument is an interface pointer other than IUnknown* or IDispatch*, you can enter the name of the interface to add the name to the list.
- Supported Property Functions—Select one or more of the Get, Put, and Put By Ref options to choose the kind of accessor functions generated for your property. You must select at least one of these options. You can create a read-only property by checking only the Get option, and you can create a write-only property by not checking the Get option.
The Put by Ref access is the same as the Put access, except that some APIs, such as Microsoft Visual Basic, expose these differently to the client programmers. Visual Basic supports Put by Ref properties only if these properties are interface pointers. For example, if there is an interface pointer property called MyProp in an interface implemented by a server object called MyObj, then
Dim obj As MyObj ‘Declare a MyObj variable in VB
Set obj = New MyObj ‘Create a MyObj object
obj.MyProp = h2 ‘VB calls put_MyProp accessor
Set obj.MyProp = h2 ‘VB calls putref_MyProp accessor
It is strongly recommended that you use Put by Ref access only for interface pointer properties and, for those properties, select both Put and Put by Ref for write access so that Visual Basic programmers can use either of the above syntaxes to set them.