Chapter Summary

 < Free Open Study > 



ATL's COM map is a rich playground for the C++ developer to romp around in. Typically the COM_INTERFACE_ENTRY macro is all you need to concern yourself with; however, this chapter has examined a number of additional macros and when you might want to use them.

Nested classes may be used as an interface implementation technique and are quite helpful when dealing with name clashes resulting from COM interfaces with duplicate method names. We examined how to use ATL to create wrapper classes which resolve the name clash before it becomes a problem in the supporting coclass.

Tear-off interfaces are a technique that allows the COM developer to make an educated guess. If you feel some of your COM interfaces are used infrequently, you may help reduce the overall size of the object by delaying the creation of vPtrs until explicitly asked by a COM client. Recall that if the client happens to ask for the interface you assume is no longer necessary, you will end up with a larger footprint than if you simply supported the interface in the first place. Use with caution.

Finally, we examined COM's binary reuse mechanisms: containment and aggregation. Containment maps quite well to the C++ techniques you are already comfortable with. Aggregation is not as common as containment; however, ATL provides a number of COM map macros to facilitate aggregation.



 < Free Open Study > 



Developer's Workshop to COM and ATL 3.0
Developers Workshop to COM and ATL 3.0
ISBN: 1556227043
EAN: 2147483647
Year: 2000
Pages: 171

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net