獲取CTabView中不同Tab頁

2021-05-27 19:31:11 字數 1024 閱讀 3302

問題描述:在ctabview派生類中新增多個cformview類的試圖頁,在處理訊息時需要獲得接收訊息的視窗的控制代碼,為了得到不同cformview派生類的控制代碼,在網上查了好久才找到的點提示;現將解決方案描述如下,以供參考。

to add tabs to my view during creation, i just do this in the oncreate of my ctabview-derived class:

int addview( cruntimeclass* pviewclass, const cstring& strviewlabel, int iindex=-1, ccreatecontext* pcontext=null );

eg:addview(runtime_class(cchartview), 「chart」,101);

cchartview * p = dynamic_cast

note:

gettabview()//得到ctabview派生類的指標

cview * pview = getactiveview();

cmfctabview *pparent = (cmfctabview *)pview->getparent();

ctabview *ptabview = (ctabview *)pparent ->getparent();

return ptabview ;

方案中用到乙個關鍵的函式,看看msdn對該函式的解釋:

引數

[in] itab

the zero-based index of a tab.

cview *pcurrentview = getactiveview();//得到當前活動tabview的指標

int tabindex = gettabview()->findtab(pcurrentview->m_hwnd); //得到當前活動tabview的index

if(tabindex ?= 欲開啟的tabview) 可以判斷某個特定的tabview是否active

金融中TA的概念

ta是transfer agent縮寫,通常稱為 登記過戶 ta系統 登記過戶系統 在乙隻金融產品生命週期中,最重要的作用有 1 管理產品 客戶的份額 2 收益計算。其他功能 賬戶開戶 銷戶 客戶資料修改 賬戶凍結 解凍 賬戶登記 取消登記 認購 申購 贖回 轉委託 非交易過戶 產品轉換 修改分紅方...

vim中buffer windows和tab的概念

vim 中的 window 和 tab 非常具有迷惑性,跟我們平時所說的 視窗 和 標籤頁 是完全不同的兩個概念,請看 vimdoc 給出的定義 1 a buffer is the in memory text of a file.2 a window is a viewport on a buff...

Python 利用正則獲取json中不同的資料型別

筆者在寫xx爬蟲的時候,需要獲取頁面請求返回的json資料中的某些資料,遇見如下的 key value id value 或者是 key value ratedate value 區別在於value是否帶引號,並且需要獲取相應的value值,筆者通過正則快速解決 1 key value id val...