By default, the Snap-In wizard generates a standard snap-in object. However, if you choose the Snap-In Extension option, the generated code will differ from the standard snap-in code. Specifically, the difference lies in the data class object of the snap-in extension (CMySnapInData
). There are two main differences, both occurring in the header file of the generated data class.
InitDataClass
, in CMySnapInData
. The InitDataClass
method provides a safe method for initializing the m_pDataObject
member of the extension data class (CMySnapInExtData
). The default implementation caches a pointer to the snap-in object being extended, in the m_pDataObject
member. In most cases, no further action is required.However, if the extended snap-in data object needs to be converted to the internal format (which the data represents) before being cached, this method provides a convenient access point to perform that conversion.
CMySnapInExtData
). The macro, found before the new map, creates a data member of type CMySnapInExtData
in the extended snap-in object. After this macro, the extension node info map is declared. The declaration includes the BEGIN_EXTENSION_SNAPIN_NODEINFO_MAP, END_EXTENSION_SNAPIN_NODEINFO_MAP, and EXTENSION_SNAPIN_NODEINFO_ENTRY macros. Each entry in the map specifies the CMySnapInExtData
class.