求教:如下函式中注釋部分?
void CToolBar::_GetButton(int nIndex, TBBUTTON* pButton) const
{
CToolBar* pBar = (CToolBar*)this;
VERIFY(pBar->DefWindowProc(TB_GETBUTTON, nIndex, (LPARAM)pButton));
// TBSTATE_ENABLED == TBBS_DISABLED so invert it
pButton->fsState ^= TBSTATE_ENABLED;// 這里為什么要進行此操作???是什么意思
}
uj5u.com熱心網友回復:
位運算子有:&(按位與)、|(按位或)、^(按位異或)、~ (按位取反)。
#define TBSTATE_ENABLED 0x04
#define TBBS_DISABLED MAKELONG(0, TBSTATE_ENABLED) // button is disabled
uj5u.com熱心網友回復:
//#define TBSTATE_ENABLED 0x04//#define TBBS_DISABLED MAKELONG(0, TBSTATE_ENABLED) // button is disabled
int x=TBSTATE_ENABLED;
x^= TBSTATE_ENABLED;
afxDump << x << "\n";//=0
x^= TBSTATE_ENABLED;
afxDump << x << "\n";//=4
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/133310.html
標籤:基礎類
上一篇:關于程式的管理員權限問題
