STR +=_T (" not exactly match fingerprint, fuzzy matching!" );
SetDlgItemText (IDC_EDIT1, STR);
SendMessage (WM_UPDATEDATA, FALSE);
I just learning MFC, a lot of things all don't understand, when doing OS detection, in the edit control controls the display content, the program runs without exception, but the content can't display, don't know why, please everyone a great god help to look at, thank you! Here is my part of the code in a dialog box:
IMPLEMENT_DYNAMIC (CJiemianDlg CDialogEx)
CJiemianDlg: : CJiemianDlg (pParent/*=NULL CWnd * */)
: CDialogEx (IDD_JM_DIALOG, pParent)
{
}
CJiemianDlg: : ~ CJiemianDlg ()
{
}
Void CJiemianDlg: : DoDataExchange (CDataExchange * symbol)
{
CDialogEx: : DoDataExchange (symbol);
DDX_Control (symbol, IDC_EDIT1 m_edit1);
}
BEGIN_MESSAGE_MAP (CJiemianDlg CDialogEx)
ON_BN_CLICKED (IDC_BUTTON2, & amp; CJiemianDlg: : OnBnClickedButton2)
ON_BN_CLICKED (IDC_BUTTON1, & amp; CJiemianDlg: : OnBnClickedButton1)
ON_BN_CLICKED (IDC_BUTTON7, & amp; CJiemianDlg: : OnBnClickedButton7)
ON_BN_CLICKED (IDC_BUTTON6, & amp; CJiemianDlg: : OnBnClickedButton6)
END_MESSAGE_MAP ()
//CJiemianDlg message handler
Void CJiemianDlg: : OnBnClickedButton2 ()
{
//TODO: add the control notification handler code
CAdpDlg adpDlg;
If (adpDlg DoModal ()==IDOK)
{
M_pDevice=adpDlg. Returnd ();
}
}
BOOL CJiemianDlg: : OnInitDialog ()
{
CDialogEx: : OnInitDialog ();
//TODO: add additional initialization here
M_tcpCount=0;
M_udpCount=0;
M_arpCount=0;
M_icmpCount=0;
M_igmpCount=0;
M_totalCount=0;
M_httpCount=0;
M_dnsCount=0;
M_wangCount=0;
M_qqCount=0;
M_msnCount=0;
return TRUE;//return TRUE unless you set the focus to a control
//exception: OCX property page should return FALSE
}
Void CJiemianDlg: : OnBnClickedButton1 ()
{
//TODO: add the control notification handler code
CIPDlg ipDlg;
If (ipDlg DoModal ()==IDOK)
{
StrIP2=ipDlg. Returnstr ();
}
}
Void CJiemianDlg: : Compare (u_short tlen, u_char TTL, u_short flag, u_short winsize)
{
U_short xtlen, xflag xwinsize;
U_char XTTL;
Xtlen=tlen;
XTTL=TTL;
Xflag=flag;
Xwinsize=winsize;
Char TTLmin TTLmax;
Int flbel=0;
Cstrings STR.
The switch (flag)
{
Case 0:
Case 1:
Case 4:
Case 5: DF=0; break;
Case 2:
Case 3:
Case 6:
Case 7: DF=1; break;
}
If (TTL & gt; 0 x23 & amp; & TTL & lt;=0 x45)
{
TTLmin=0 x3b;
TTLmax=0 x45;
}
If (TTL & gt; 0 x45 & amp; & TTL & lt;=0 x85)
{
TTLmin=0 x7b;
TTLmax=0 x85;
}
If (TTL & gt; 0 & amp; & TTL & lt;=0 x23)
{
TTLmin=0 x19;
TTLmax=0 x23;
}
Char OS [20];
//char win []={winsize};
Int right and left;
Right=winsize & amp; 0 x00ff;
Left=winsize & gt;> 8;
Char finger1 [30].
Char finger2 [30].
Finger1 [0]=DF;
Finger1 [1]=':';
Finger1 [2]=TTLmin;
Finger1 [3]=':';
Finger1 [4]=TTLmax;
Finger1 [5]=':';
Finger1 [6]=left;
Finger1 [7]=right;
Finger1 [8]=':';
Finger1 [9]=static_cast & lt; Unsigned char> (tlen);
Int hang, lie, ka;
For (hang=0; Hang<20; Hang++)
{
For (lie=0; FingerDB [hang] [lie]!=':'; Lie++)
{
OS (lie)=fingerDB [hang] [lie];
}
For (ka=lie + 1; FingerDB [hang] [ka]!='*'; Ka++)
{
If (fingerDB [hang] [ka]=='*')
break;
Finger2/ka - (lie + 1)=fingerDB [hang] (ka);
}
//int nLen=WideCharToMultiByte (finger1 CP_ACP, 0, 1, NULL, 0, NULL, NULL);
//char * finger3=new char [nLen];
//WideCharToMultiByte (finger1 CP_ACP, 0, 1, finger3, nLen, NULL, NULL);
If (STRCMP (finger2, finger1)==0)
{
//HWND HWND=GetDlgItem (Csniffer2Dlg IDC_EDIT3);
STR. The Format (_T (" the operating system may be as follows: % s "), * OS);
This - & gt; SetDlgItemText (IDC_EDIT1, STR);
Flbel=1;
exit(0);
}
}
If (flbel==0)
{
//CWnd * editwnd=GetDlgItem (IDC_EDIT1);
STR +=_T (" not exactly match fingerprint, fuzzy matching!" );
SetDlgItemText (IDC_EDIT1, STR);
SendMessage (WM_UPDATEDATA, FALSE);
If (xtlen==12288)
C_totallength='c';
The else
C_totallength='n'.
If (XTTL & lt;
=64)C_ttl='l';
Else if (64 & lt; TTL & lt;
=128)C_ttl='w';
The else
C_ttl='u';
The switch (xwinsize)
{
Case 0 x0020:
{
Const char * CPC="v";
C_win=new char [strlen (CPC) + 1);
Strcpy (c_win, CPC);
break;
}
Case 0 XFFFF:
{
Const char * CPC="x";
C_win=new char [strlen (CPC) + 1);
Strcpy (c_win, CPC);
break;
}
Case 0 x7044:
{
Const char * CPC="p";
C_win=new char [strlen (CPC) + 1);
Strcpy (c_win, CPC);
break;
}
Case 0 x4000:
{
Const char * CPC="3";
C_win=new char [strlen (CPC) + 1);
Strcpy (c_win, CPC);
break;
}
Case 0 xfc00:
{
Const char * CPC="3";
C_win=new char [strlen (CPC) + 1);
Strcpy (c_win, CPC);
break; nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull