Click here to Skip to main content
15,901,205 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionVfw decompression - real sample code wanted Pin
Vaclav_14-May-12 8:24
Vaclav_14-May-12 8:24 
QuestionDrawImage from 2 image buffer Pin
john563213-May-12 23:34
john563213-May-12 23:34 
AnswerRe: DrawImage from 2 image buffer Pin
Richard MacCutchan14-May-12 0:17
mveRichard MacCutchan14-May-12 0:17 
QuestionIPC using named pipes Pin
ForNow13-May-12 9:27
ForNow13-May-12 9:27 
GeneralRe: IPC using named pipes Pin
«_Superman_»13-May-12 16:15
professional«_Superman_»13-May-12 16:15 
AnswerRe: IPC using named pipes Pin
ThatsAlok13-May-12 20:06
ThatsAlok13-May-12 20:06 
AnswerRe: IPC using named pipes Pin
Software_Developer14-May-12 0:02
Software_Developer14-May-12 0:02 
Questionc++, CryptGetHashParam works in XP, Vista, but not Windows 7 Pin
jkirkerx13-May-12 8:49
professionaljkirkerx13-May-12 8:49 
Answer[SOLVED] Re: c++, CryptGetHashParam works in XP, Vista, but not Windows 7 Pin
jkirkerx13-May-12 10:13
professionaljkirkerx13-May-12 10:13 
Questionwhere should add the try-catch? Pin
yu-jian13-May-12 5:55
yu-jian13-May-12 5:55 
AnswerRe: where should add the try-catch? Pin
Richard MacCutchan13-May-12 6:45
mveRichard MacCutchan13-May-12 6:45 
GeneralRe: where should add the try-catch? Pin
yu-jian13-May-12 18:39
yu-jian13-May-12 18:39 
AnswerRe: where should add the try-catch? Pin
ThatsAlok13-May-12 20:08
ThatsAlok13-May-12 20:08 
GeneralRe: where should add the try-catch? Pin
Richard MacCutchan13-May-12 21:41
mveRichard MacCutchan13-May-12 21:41 
AnswerRe: where should add the try-catch? Pin
TinyDevices13-May-12 20:59
professionalTinyDevices13-May-12 20:59 
GeneralRe: where should add the try-catch? Pin
yu-jian13-May-12 22:24
yu-jian13-May-12 22:24 
AnswerRe: where should add the try-catch? Pin
Aescleal14-May-12 3:15
Aescleal14-May-12 3:15 
QuestionNeed Help with Audio Output in C/C++ Pin
Veeshal Beotra13-May-12 4:12
Veeshal Beotra13-May-12 4:12 
AnswerRe: Need Help with Audio Output in C/C++ Pin
Vaclav_14-May-12 8:35
Vaclav_14-May-12 8:35 
QuestionChanging the background color of Text control or combo box when text got changed Pin
Ashish Ranjan Mishra13-May-12 4:01
Ashish Ranjan Mishra13-May-12 4:01 
AnswerRe: Changing the background color of Text control or combo box when text got changed Pin
«_Superman_»13-May-12 4:12
professional«_Superman_»13-May-12 4:12 
Question'Forward Class Declaration' Not Working Pin
AmbiguousName12-May-12 20:44
AmbiguousName12-May-12 20:44 
hello guys... I am having a debug assertion when trying to use forward class declaration. Basically I have this CMyTabCtrl inwhich I have forward declared two dialog class, like this:

CMyTabCtrl.h
C++
class	CTabOneDlg;
class	CTabTwoDlg;


And now in the implementaion file, I am using these pointers to create instances of two dialogs and add them to the TabCtrl.
Here are the constructor and the InitializeTabs() functions.

CMyTabCtrl.cpp
CMyTabCtrl::CMyTabCtrl()
{
   m_arrTabs[0] = new CTabOneDlg; //CDialog* m_arrTabs[2];
   m_arrTabs[1] = new CTabTwoDlg;

   m_tabOne = (CTabOneDlg*)m_arrTabs[0]; // CTabOneDlg* m_tabOne; 
   m_tabTwo = (CTabTwoDlg*)m_arrTabs[1]; // CTabTwoDlg* m_tabTwo; 
}

coid CMyTabCtrl::InitializeTabs()
{
	this->InsertItem(0, _T("Faculty"));
	this->InsertItem(1, _T("Admin"));

	//create the dialogs
	m_arrTabs[0]->Create(IDD_TAB1_DLG, this);
	m_arrTabs[1]->Create(IDD_TAB2_DLG, this);

	//show the firs and hide the rest
	m_arrTabs[0]->ShowWindow(SW_SHOW);
	m_arrTabs[1]->ShowWindow(SW_HIDE);
}


And finally when in MainDialogDlg.cpp, I try to forward declare this CMyTabCtrl class, it gives debug assertion on the second line of the InitializeTabs() function.

CMainDialogDlg.h
C++
class CMyTabCtrl;

CMyTabCtrl *tabCtrl;


CMainDialogDlg.cpp
C++
BOOL CMainDialogDlg::OnInitDialog()
{
    tabCtrl = new CMyTabCtrl;
    tabCtrl->InitizlizeTabs();
}

The debug assertion it gives is as follows
mfc100ud.dll!CTabCtrl::InsertItem(int nItem, const wchar_t * lpszItem)  Line 570 + 0x2d bytes	C++


Why it is giving debug assertion on the InsertItem() function in the InitializeTabs() function. Thanks for at least giving time to read it.

This world is going to explode due to international politics, SOON.

QuestionRe: 'Forward Class Declaration' Not Working Pin
«_Superman_»12-May-12 20:53
professional«_Superman_»12-May-12 20:53 
AnswerRe: 'Forward Class Declaration' Not Working Pin
AmbiguousName12-May-12 22:23
AmbiguousName12-May-12 22:23 
AnswerRe: 'Forward Class Declaration' Not Working Pin
Richard MacCutchan12-May-12 21:30
mveRichard MacCutchan12-May-12 21:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.