I am trying to add a CTabCtrl into my MFC application. I am trying to follow the MSDN directly.
*MSDN: Adding Tabs to Tab Control
Here is what I have tried:
DDX_Control(pDX, TAB1, m_TabCtrl);
TC_ITEM ti;
ti.mask = TCIF_TEXT;
ti.pszText = _T("First Tab");
m_TabCtrl.InsertItem(0,&ti);
I am receiving the following error message:
If I hit ignore, my CTabCtrl is shown, but without any tabs (just a gray square). If I hit retry, I get the breakpoint at:
_AFXCMN_INLINE BOOL CTabCtrl::SetItem(int nItem, TCITEM* pTabCtrlItem)
{ ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TCM_SETITEM, nItem, (LPARAM)pTabCtrlItem); }
I have tried adding the header #include "afxcmn.h"
but it does not change anything.
I am simply trying to get named tabs to show on my application as a first step. Eventually I wish for the tabs to show modeless dialogs. Can someone tell me what I am doing wrong? Is there a better way to use tabs in MFC?
OnInitDialog() {
of my main Dialog's class. – Kyle Williamson