Effects of Options on the Generated Files

MYSNAPIN.H and MYSNAPIN.RGS are the only files affected by the options on the second page.

MYSNAPIN.H

Each interface, from the IExtend* radio button group, that is checked adds a declaration of that specific interface to the CMySnapInComponent class. For instance, choosing the IExtendControlbar interface adds the following line to the member-wise initialization of the class:

public IExtendControlbarImpl<CMySnapInComponent>,

and the following line to CMySnapInComponent's COM map:

COM_INTERFACE_ENTRY(IExtendControlbar)

Similar modifications are made to CMySnapInComponent for the type of persistence chosen.

In addition to the modifications above, all methods of the persistence interface chosen are declared in MYSNAPIN.H. For instance, the following code is added if you choose IPersistStorage as the type of persistence:

STDMETHOD(GetClassID)(CLSID *pClassID)
{
    ATLTRACENOTIMPL(_T("CMySnapInComponent::GetClassID"));
}

//additional IPersistStorage methods
...

virtual HRESULT STDMETHODCALLTYPE HandsOffStorage()
{
    ATLTRACENOTIMPL(_T("CMySnapInComponent::HandsOffStorage"));
}

The modifications are similar for the CMySnapIn class.

If the ISnapInAbout interface is chosen, a separate class is declared (CMySnapInAbout), and the standard methods are declared.

MYSNAPIN.RGS

If the snap-in is a snap-in extension, the .RGS file generated by the wizard will differ slightly from the default. Specifically, two portions in the NoRemove MMC section will be modified to associate the snap-in extension object with the extended snap-in object.

For example, the following section sample is from a default snap-in object's .RGS file:

NoRemove MMC
    {
        NoRemove Snapins
        {
            ForceRemove {ACC4CCCD-8C61-11D1-B017-00C04FB99436} =
            s 'MySnapIn' 
            {
                val NameString = s 'MySnapIn'
                val About = s '{ACC4CCCE-8C61-11D1-B017-00C04FB99436}'
                NodeTypes
                {
                    {ACC4CCCF-8C61-11D1-B017-00C04FB99436}
                }
                StandAlone
            }
        }
        NoRemove NodeTypes
        {
            ForceRemove {ACC4CCCF-8C61-11D1-B017-00C04FB99436}
            {
            }

        }
    }

However, for the snap-in extension, the NoRemove MMC section differs:

NoRemove MMC
    {
        NoRemove Snapins
        {
            ForceRemove {ACC4CCD5-8C61-11D1-B017-00C04FB99436} =
            s 'MySnapInDataExt1' 
            {
                val NameString = s 'MySnapInDataExt1'
                val About = s '{ACC4CCD6-8C61-11D1-B017-00C04FB99436}'
            }
        }
        NoRemove NodeTypes
        {
            NoRemove {}
            {
                NoRemove Extensions
                {
                    NoRemove PropertySheet
                    {
                        val {ACC4CCD5-8C61-11D1-B017-00C04FB99436} =
                        s 'MySnapInDataExt1'
                    }
                    NoRemove ToolBar
                    {
                        val {ACC4CCD5-8C61-11D1-B017-00C04FB99436} =
                        s 'MySnapInDataExt1'
                    }
                }
            }

        }
    }