本文整理汇总了C++中CDialog::GetSafeHwnd方法的典型用法代码示例。如果您正苦于以下问题:C++ CDialog::GetSafeHwnd方法的具体用法?C++ CDialog::GetSafeHwnd怎么用?C++ CDialog::GetSafeHwnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDialog
的用法示例。
在下文中一共展示了CDialog::GetSafeHwnd方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddMessage
void CMSG_Server::AddMessage(char *strMessage, int size, int color)
{
CDialog *pDlg = (CDialog*)pMainDlg;
::PostMessageA(pDlg->GetSafeHwnd(),ID_MSG_STATE,0,(LPARAM)strMessage);
}
示例2: OnClickListMorphadata
//.........这里部分代码省略.........
var = rs->GetCollect("pspermmethod");
pDlg->m_strEditSpermWay = (char*)(_bstr_t)var;
// pDlg->m_strEditSpermWay.TrimLeft();
// pDlg->m_strEditSpermWay.TrimRight();
var = rs->GetCollect("pliquifytime");
pDlg->m_strEditLiquifyTime = (char*)(_bstr_t)var;
// pDlg->m_strEditLiquifyTime.TrimLeft();
// pDlg->m_strEditLiquifyTime.TrimRight();
pDlg->UpdateData(FALSE);
}
catch (_com_error& e)
{
AfxMessageBox(e.Description());
return;
}
//
str.Format("select * from morphasperminfo where pid like('%s%%')", pDlg->m_strEditDetectNO);
try
{
_RecordsetPtr rs=theConnection->Execute((LPCTSTR)str,NULL,adCmdText);
_variant_t vt;
SingleSpermInfo ssInfo;
pDlg->m_vSpermInfo.clear();
while(!rs->EndOfFile)
{
vt = rs->GetCollect("x");
ssInfo.pos.x = (long)vt;
vt = rs->GetCollect("y");
ssInfo.pos.y = (long)vt;
vt = rs->GetCollect("pid");
CString cs;
cs = (char*)(_bstr_t)vt;
int nl = cs.ReverseFind('_');
nl = cs.GetLength()-nl-1;
cs = cs.Right(nl);
ssInfo.nSpermNO = atol((LPCTSTR)cs);
vt = rs->GetCollect("IsNormal");
ssInfo.bIsNormal = (bool)vt;
vt = rs->GetCollect("m_length");
ssInfo.smPara.m_length = (double)vt;
vt = rs->GetCollect("m_width");
ssInfo.smPara.m_width = (double)vt;
vt = rs->GetCollect("m_area");
ssInfo.smPara.m_area = (double)vt;
vt = rs->GetCollect("m_ellipticity");
ssInfo.smPara.m_ellipticity = (double)vt;
vt = rs->GetCollect("m_perfor_area");
ssInfo.smPara.m_perfor_area = (double)vt;
vt = rs->GetCollect("m_head_area");
ssInfo.smPara.m_head_area = (double)vt;
vt = rs->GetCollect("m_perimeter");
ssInfo.smPara.m_perimeter = (double)vt;
vt = rs->GetCollect("m_head_perfor_area");
ssInfo.smPara.m_head_perfor_area = (double)vt;
vt = rs->GetCollect("m_tail_length");
ssInfo.smPara.m_tail_length = (double)vt;
vt = rs->GetCollect("m_tail_width");
ssInfo.smPara.m_tail_width = (double)vt;
vt = rs->GetCollect("m_tail_angle");
ssInfo.smPara.m_tail_angle = (double)vt;
vt = rs->GetCollect("m_extension");
ssInfo.smPara.m_extension = (double)vt;
vt = rs->GetCollect("m_symmetry");
ssInfo.smPara.m_symmetry = (double)vt;
vt = rs->GetCollect("m_ruga");
ssInfo.smPara.m_ruga = (double)vt;
pDlg->m_vSpermInfo.push_back(ssInfo);
rs->MoveNext();
}
// Update UI button
UINT uSelectedCount = m_wndMorphaDataList.GetSelectedCount();
BOOL enable = uSelectedCount>=1 ? TRUE : FALSE;
CDialog *pdlg = ((CMainFrame*)AfxGetMainWnd())->m_pWndMorphadlg;
::SendMessage(pdlg->GetSafeHwnd(), USER_MSG_SHOW_PRINT_BTN, (WPARAM)enable, 0);
::SendMessage(pdlg->GetSafeHwnd(), USER_MSG_SHOW_MOPHY_DEL_SEL_BTN, (WPARAM)enable, 0);
}
catch (_com_error& e)
{
MessageBox(e.Description());
return;
}
*pResult = 0;
}