cclientdc
派生於cdc
類,在建構函式時呼叫
getdc
函式,在析構時呼叫
releasedc
函式。
cclientdc dc(this); //cclientdc dc(getparent()); 可繪製直線到工具欄等地方
dc.moveto(m_ptorigin);
dc.lineto(point);
mfc cclientdc實現畫圖主要**:
// lineview.h : clineview 類的介面
public:
// 用來記錄滑鼠位置
cpoint start;
afx_msg void onlbuttondown(uint nflags, cpoint point);
afx_msg void onlbuttonup(uint nflags, cpoint point);
afx_msg void onmousemove(uint nflags, cpoint point);
// lineview.cpp : clineview 類的實現
void clineview::onlbuttondown(uint nflags, cpoint point)
void clineview::onlbuttonup(uint nflags, cpoint point)
void clineview::onmousemove(uint nflags, cpoint point)
}
CPaintDC和CClientDC的區別
1 cclientdc 客戶區裝置上下文 用於客戶區的輸出,它在建構函式中封裝了getdc 在析構函式中封裝了releasedc 函式。一般在響應非視窗重畫訊息 如鍵盤輸入時繪製文字 滑鼠繪圖 繪圖時要用到它。用法是 cclientdcdc this this一般指向本視窗或當前活動檢視 dc.te...
CClientDC和CDC的區別
hdc是windows的一種資料型別,是裝置描述控制代碼 cdc是mfc封裝的windows 裝置相關的乙個類 cclientdc是cdc的衍生類,產生對應於windows客戶區的物件,在構造的時候呼叫getdc,在析構的時候呼叫releasedc cwindowdc也是cdc的衍生類,在構造的時候...
利用MFC獲取網頁內容
include include include include include include include include using namespace std string gethtml cstring url pfile close delete pfile session.close ...