本文整理汇总了C++中CEdit::GetHandle方法的典型用法代码示例。如果您正苦于以下问题:C++ CEdit::GetHandle方法的具体用法?C++ CEdit::GetHandle怎么用?C++ CEdit::GetHandle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEdit
的用法示例。
在下文中一共展示了CEdit::GetHandle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnClickedDecodeh
void CStationDlg::OnClickedDecodeh(void)
{
CEdit *cetodo = (CEdit *) CWnd::GetDlgItem(IDC_TODO1);
int i,j;
cetodo->GetSel(i,j);
// NT SPECIFIC
HLOCAL h = cetodo->GetHandle();
LPCTSTR lpszText = (LPCTSTR)LocalLock(h);
char res[1000];
strncpy(res,&(lpszText[i]),j-i);
SetDlgItemText(IDC_DECDEC,res);
unsigned short f;
unsigned char *pf;
unsigned int b1,b2;
pf = (unsigned char *)&f;
sscanf(res,"%x %x",&b1,&b2);
pf[0] = b1;
pf[1] = b2;
CString sres;
sres.Format("%04X = %d",f,f);
SetDlgItemText(IDC_DECFLOAT,sres);
LocalUnlock(h);
// END OF NT SPECIFIC
}
示例2: OnClickedDecodesel
void CStationDlg::OnClickedDecodesel(void)
{
CEdit *cetodo = (CEdit *) CWnd::GetDlgItem(IDC_TODO1);
int i,j;
cetodo->GetSel(i,j);
// NT SPECIFIC
HLOCAL h = cetodo->GetHandle();
LPCTSTR lpszText = (LPCTSTR)LocalLock(h);
char res[1000];
strncpy(res,&(lpszText[i]),j-i);res[j-i] = 0;
CString sres = res;
sres.Replace("\r\n","");
SetDlgItemText(IDC_DECDEC,sres);
float f;
unsigned char *pf;
unsigned int b1,b2,b3,b4;
pf = (unsigned char *)&f;
sscanf(sres,"%x %x %x %x",&b1,&b2,&b3,&b4);
pf[0] = b1;
pf[1] = b2;
pf[2] = b3;
pf[3] = b4;
sres.Format("%g",f);
SetDlgItemText(IDC_DECFLOAT,sres);
LocalUnlock(h);
// END OF NT SPECIFIC
}