学习总结 CButton/SetCheck String/Compare

来源:互联网 发布:电脑端口怎么打开 编辑:程序博客网 时间:2024/06/06 09:45

1  在进行Radio 类型按钮的时候设定按钮的 选中与未选中状态时 

((CButton*)GetDlgItem(IDC_CHECK_VISION_ENABLE))->SetCheck(MACHINE.m_bVisionEnable ? BST_CHECKED : BST_UNCHECKED);

其中若MACHINE.m_bVisionEnable为true时,选中BST_CHECKED表示为1.BST_UNCHECKED为0.表示没有选中


2 CString /Compare

//引自MSDN

int Compare( LPCTSTR lpsz ) const;

Return Value

Zero if the strings are identical, < 0 if this CString object is less thanlpsz, or > 0 if this CString object is greater than lpsz.


Example

The following example demonstrates the use of CString::Compare.

// example for CString::CompareCString s1( "abc" );CString s2( "abd" );ASSERT( s1.Compare( s2 ) == -1 ); // Compare with another CString.ASSERT( s1.Compare( "abe" ) == -1 ); // Compare with LPTSTR string. 



0 0
原创粉丝点击