AnnGetSecondaryMetaFile example for C++ 5 and later
Void CTutorDlg::ExampleAnnGetSecondryMetafile(long hObject)
{
long hMetafile1;
long hMetafile2;
AnnObjectType nType;
L_BOOL bEncryptorOriginal;
m_pRasterAnn->AnnGetType(hObject);
nType = m_pRasterAnn->GetAnnType();
if(nType != ANN_OBJECT_ENCRYPT)
{
MessageBox(TEXT("this object is not an encryptor object"));
return 0;
}
hMetafile1 = m_pRasterAnn->AnnGetMetafile(hObject);
hMetafile2 = m_pRasterAnn->AnnGetSecondaryMetafile(hObject);
m_pRasterAnn->AnnEncryptOptions->Flags = ANN_ENCRYPT_ALL;
m_pRasterAnn->AnnGetEncryptOptions(hObject);
bEncryptorOriginal = m_pRasterAnn->AnnEncryptOptions->EnableEncryptor;
//Set state to Decryptor and set Decryptor metafile
m_pRasterAnn->AnnEncryptOptions->Flags = ANN_ENCRYPT_TYPE;
m_pRasterAnn->Flags = 0;
m_pRasterAnn->AnnEncryptOptions->EnableEncryptor = TRUE;
m_pRasterAnn->AnnSetEncryptOptions (hObject);
m_pRasterAnn->AnnSetMetafile( hObject, hMetafile2, ANN_METAFILE_USER, FALSE);
//Set state to Decryptor and set Decryptor metafile
m_pRasterAnn->Flags = 0;
m_pRasterAnn->AnnEncryptOptions->EnableEncryptor = TRUE;
m_pRasterAnn->AnnSetEncryptOptions (hObject);
m_pRasterAnn->AnnSetMetafile (hObject, hMetafile2, ANN_METAFILE_USER, FALSE);
m_pRasterAnn->AnnEncryptOptions->EnableEncryptor = bEncryptorOriginal;
m_pRasterAnn->Flags = 0;
m_pRasterAnn->AnnSetEncryptOptions (hObject);
}