AnnGetHyperlinkType example for C++ 4.0 and later
Note: This topic is for Document/Medical only.
The following is an example of AnnHyperlink event code which includes a call to AnnGetHyperlinkType.
void CTestocxDlg::OnAnnHyperlink Leadctrl1(long hObject, short iParamCount, long lParam1, long lParam2, long lParam3, long lParam4, long lParam5)
{
CString msgstr;
CString tmp;
int nType;
nType = m_Lead1.AnnGetHyperlinkType(hObject);
if ((nType == ANNLINK_ANNEVENT5) || (nType == ANNLINK_ANNEVENT))
{
if (iParamCount >= 0)
msgstr.Format("%d params are valid\n", iParamCount);
if (iParamCount >= 1)
{
tmp.Format("Param1: %ld \n", lParam1);
msgstr = msgstr + tmp;
}
if (iParamCount >= 2)
{
tmp.Format("Param2: %ld \n", lParam2);
msgstr = msgstr + tmp;
}
if (iParamCount >= 3)
{
tmp.Format("Param3: %ld \n", lParam3);
msgstr = msgstr + tmp;
}
if (iParamCount >= 4)
{
tmp.Format("Param4: %ld \n", lParam4);
msgstr = msgstr + tmp;
}
if (iParamCount >= 5)
{
tmp.Format("Param5: %ld \n", lParam5);
msgstr = msgstr + tmp;
}
}
else
msgstr.Format("Invalid Type");
AfxMessageBox(msgstr);
}