Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Objective Toolkit User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

29.4 Further Extensions


We've only exported one method. We have not exported any of the Objective Toolkit Tree control's bitmap functionality. This and other extensions are left to the developer.

You can get a good idea of how to go about extending this by examining the code for the method implementation we've provided, InsertItem():

As explained in the comments in this routine, a production version would need a great deal more error checking. Nonetheless, it does illustrate two important points.

This method can be modified (for example, to access the bitmap/imagelist functionality as described) and other methods may be defined on the Imytreecontrol interface to make functionality in the base Tree control accessible through the ActiveX control you are developing.

The Objective Toolkit libraries require initialization before they can be used. During this process, resources are allocated and made available to the module that uses them. It is important that any such resources be available only to the module and not to the application. If such resources were to live in the application, several conflicts could arise.

Consider a case where two ATL-based DLLs link in Objective Toolkit. Assume that the first performs control registration. The second is then loaded. Both work fine. Then let us assume that the first control gets terminated, while the rest of the application continues to run. Like any good control, the first control cleans up after itself, un-registering the class. When the second control tries to create a control of this class, it fails.

Objective Toolkit is completely aware of these issues and can be used freely inside different ATL modules. Remember to call AFX_MANAGE_STATE(AfxGetStaticModuleState()) when you export functions that will be called from other modules. Non-module state-aware MFC controls will fail under these situations.

In this chapter, we have provided guidelines and working code, as well as code generation helpers, for better ATL compatibility with Objective Toolkit. Please contact us if you encounter problems with this support or if there are other features that you would like to see implemented.



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.