VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



OCX interface tips

by Duncan Jones (19 Submissions)
Category: OLE/COM/DCOM/Active-X
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (4 Votes)

3 tips that you should definitely use to make your own developed ActiveX controls more developer friendly:

Rate OCX interface tips

(1) Use enumerated types wherever you can in your control's interface


- When you create a property for your control, try to define it as an enumerated type wherever possible. Doing so allows the Visual Basic IDE to populate a listbox with the values and their description in the "properties" tab. Thus where the ImageMap control has a ControlMode property which says how the control is behaving, the property is implemented as an enumerated type:




Private Enum enControlMode
  cm_Runtime = 1     '\\ The control is in runtime mode
  cm_DesignTime_Selecting '\\ Control is design time but no ImageMapItem is selected
  cm_DesignTime_Selected '\\ Control is in design time and an ImageMapItem is selected
  cm_DesignTime_Drawing  '\\ Control is drawing a new ImageMapItem
End Enum



This gives the developer more information about what the property is all about.


(2) Use the "Procedure Attributes" screen to give extra information about your properties. Bringing up the procedure attributes screen to set extra information about your properties. In particular, pressing the "Advanced >>>" button brings up three drop down boxes - Procedure ID:, Use this page in property browser:, and Property Category:.


(3) Fill the "Description" box of the "Procedure Attributes" box with a short but informative description. This information is displayed when that property is the currently selected one in the property browser widnow.

Download this snippet    Add to My Saved Code

OCX interface tips Comments

No comments have been posted about OCX interface tips. Why not be the first to post a comment about OCX interface tips.

Post your comment

Subject:
Message:
0/1000 characters