Hour 15

   

1:

In the ATLAttributes project created in this hour, the CAttributeTest class doesn't appear to derive from the standard ATL classes, such as CComObjectRootEx. Explain why the ATL classes are not in the CAttributeTest derivation list.

A1:

The coclass attribute injects the code that provides that derivation. If you look at the merged source, you will see your class and all its base classes as a result of applying that attribute.

2:

What is meant when its said that an attribute is context sensitive?

A2:

Although you might think it has something to do with letter case, context sensitivity within attributes refers to the notion that an attribute is aware of what context it is being applied in. In other words, an attribute knows whether it is being applied to a class or an interface, for instance.


   
Top


Sams Teach Yourself Visual C++. NET in 24 Hours
Sams Teach Yourself Visual C++.NET in 24 Hours
ISBN: 0672323230
EAN: 2147483647
Year: 2002
Pages: 237

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