AnnSetMetafile Example for Visual C++
HMETAFILE hMeta;
VARIANT_BOOL bEnh;
hMeta = (HMETAFILE)m_pRasterAnn->AnnGetPredefinedMetafile (ANN_METAFILE_IMPORTANT );
bEnh = m_pRasterAnn->GetAnnPredefinedMetafileEnhanced();
m_pRasterAnn->AnnSetPredefinedMetafile (ANN_METAFILE_TOPSECRET, (long)hMeta);
m_pRasterAnn->AnnSetMetafile (hStamp, 0, ANN_METAFILE_TOPSECRET, FALSE);
AfxMessageBox(TEXT("stamp set to TopSecret"));
hMeta = (HMETAFILE)m_pRasterAnn->AnnGetMetafile (hStamp);
switch(::GetObjectType(hMeta))
{
case OBJ_ENHMETAFILE:
AfxMessageBox(TEXT("Type is EMF"));
case OBJ_METAFILE:
AfxMessageBox(TEXT("Type is WMF"));
}