AnnGetUserData example for C++ 5.0 and later
void CAnnSample2Dlg::SampleAnnUserData(long hObject)
{
ILEADRasterVariant * pUserData = NULL;
HRESULT hr = ::CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pUserData);
if (FAILED(hr) || !pUserData)
return ;
pUserData->Type = VALUE_STRING;
pUserData->StringValue = "This is Sample Code";
m_pRasterAnn->Flags = ANN_FLAG_NOINVALIDATE;
m_pRasterAnn->AnnSetUserData(hObject, pUserData);
pUserData->Type = VALUE_STRING;
m_pRasterAnn->AnnGetUserData(hObject, pUserData);
MessageBox(pUserData->StringValue);
pUserData->Release();
}