//MyTabCtrl.cpp: Implementing Files//#include"stdafx.h"#include"FileCleaner.h"#include"MyTabCtrl.h"//Cmytabctrlimplement_dynamic (Cmytabctrl, CTabCtrl) Cmytabctrl::cmytabctrl () {}cmytabctrl::~Cmytabctrl () {}//parameter list//number of 1th seat Windows//followed by: Window name, base class pointer, IDvoidCmytabctrl::insert (intncount ...) {//Get Customer Area dimensionsCRect RC = {}; GetClientRect (&RC); RC. Deflaterect (1, -,1,1); Va_list VL; Va_start (VL, ncount); for(inti =0; i < ncount; i++) {//Insert window name, create new windowInsertItem (i, Va_arg (VL, wchar*)); M_pdlg[i]= Va_arg (VL, cdialogex*); intID = Va_arg (VL,int); M_pdlg[i]->create (Makeintresource (ID), This); M_pdlg[i]-MoveWindow (RC); } m_pdlg[0]->ShowWindow (sw_show); Va_end (VL);} Begin_message_map (Cmytabctrl, CTabCtrl) on_notify_reflect (Tcn_selchange,&Cmytabctrl::ontcnselchange) End_message_map ()//Cmytabctrl message handlersvoidCmytabctrl::ontcnselchange (NMHDR *pnmhdr, LRESULT *PResult) { //TODO: Add control notification handler code here intn =GetCurSel (); for(inti =0; I <2; i++) { if(i = =N) {M_pdlg[i]-ShowWindow (sw_show); Continue; } M_pdlg[i]-ShowWindow (sw_hide); } *presult =0;}
#pragmaOnce//CmytabctrlclassCmytabctrl: Publicctabctrl{declare_dynamic (Cmytabctrl) Public: Cmytabctrl (); Virtual~Cmytabctrl (); voidInsert (intncount ...); CDialogEx*m_pdlg[2];protected: Declare_message_map () Public: afx_msgvoidOntcnselchange (NMHDR *pnmhdr, LRESULT *pResult);};
TAB Package 2