VB6Design the Interface
' This method must be called to enable the control
' This is how we prevent other applications from working
' with this control.
Public Sub Enable()

End Sub

' An example of a common property that you can implement
Public Sub SetUser(ByVal UserName As String)

End Sub

' Method to store the properties of the control into a PropertyBag
Public Sub StoreProperties(P As PropertyBag)

End Sub

' Method to load the properties of the control from a PropertyBag
Public Sub LoadProperties(P As PropertyBag)

End Sub

' Used to obtain a list of menu entries for this control
Public Function GetMenuEntry(Index As Integer) As String

End Function

' Called by the container to indicate that a user clicked a menu
Public Sub MenuClicked(MenuName As String)

End Sub

' Program ID of the control to make embedding easy
Public Function ProgID() As String
End Function
Listing 2 The private interface is implemented by a class named PrivateMDI in a separate ActiveX DLL, which is never distributed. The PrivateMDI class is shown here.