To support the use of licensed OCXs, the OleControl class has the class method getLicenseKey:, which is used at development time to obtain the license key. This method takes as a parameter the ProgId of the OCX and answers a string representing the license key. The license key is then cached in the Smalltalk image (for example, in a class variable of an Extended Widgets wrapper of the OCX) and used in the subsequent creation of the OleControl widget.For example, if the track bar OCX is licensed, its license key is obtained using the following code:LicenseKey is a class variable of the Extended Widgets class.Then the createPrimaryWidget:parent:argBlock: method is changed to be as follows:
|