Click here to Skip to main content
15,902,032 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Help,is anyone who can tell me how can I change the height of the item in the list control???? Pin
enhzflep3-May-09 0:08
enhzflep3-May-09 0:08 
QuestionCompletion port question Pin
followait2-May-09 19:08
followait2-May-09 19:08 
AnswerRe: Completion port question Pin
Randor 4-May-09 15:13
professional Randor 4-May-09 15:13 
QuestionProblem with inheritance Pin
Tomas(cz)2-May-09 9:25
Tomas(cz)2-May-09 9:25 
AnswerRe: Problem with inheritance Pin
Code-o-mat2-May-09 11:20
Code-o-mat2-May-09 11:20 
GeneralRe: Problem with inheritance Pin
Tomas(cz)2-May-09 21:59
Tomas(cz)2-May-09 21:59 
GeneralRe: Problem with inheritance Pin
Code-o-mat2-May-09 23:45
Code-o-mat2-May-09 23:45 
GeneralRe: Problem with inheritance Pin
Tomas(cz)3-May-09 2:12
Tomas(cz)3-May-09 2:12 
Hi,
the ASSERT failure is on line 318 in winocc.cpp file. It is in a CWnd::SetWindowPos and the problem is that m_hWnd is bad pointer.
Why I am doing all this is because of the problem with serialization. When I had member of MyCTabCtrl associated to the CTabCtrl create in the designer it worked fine till open new file. I thought I would solve this problem by having a pointer an create new instance on every OnInitialUpdate(). If there is another solution to this problem I don't mind which one would I use.
But I still don't understand what is wrong with my class. I used the name MyCTabCtrl instead of Am_AnalysisParameters_TabCtrl for simplifying.

class Am_AnalysisParameters_TabCtrl : public CTabCtrl
{
	DECLARE_DYNAMIC(Am_AnalysisParameters_TabCtrl)
public:
	Am_AnalysisParameters_TabCtrl();
	virtual ~Am_AnalysisParameters_TabCtrl();

	int viewsID[2];
	CFormView *views[2];
	void InitViews();
	void ActivateView();
protected:
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnTcnSelchange(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnSize(UINT nType, int cx, int cy);
};

implementation of the class
IMPLEMENT_DYNAMIC(Am_AnalysisParameters_TabCtrl, CTabCtrl)

Am_AnalysisParameters_TabCtrl::Am_AnalysisParameters_TabCtrl()
{
	viewsID[0] = IDD_AM_ANALYSISPARAM_BUILDINGTAB_FORMVIEW;
	viewsID[1] = IDD_AM_ANALYSISPARAM_ADVANCEDTAB_FORMVIEW;

	views[0] = new Am_AnalysisParameters_BuildingTab_FormView();
	views[1] = new Am_AnalysisParameters_AdvancedTab_FormView();
}

Am_AnalysisParameters_TabCtrl::~Am_AnalysisParameters_TabCtrl()
{
}


BEGIN_MESSAGE_MAP(Am_AnalysisParameters_TabCtrl, CTabCtrl)
	ON_NOTIFY_REFLECT(TCN_SELCHANGE, &Am_AnalysisParameters_TabCtrl::OnTcnSelchange)
	ON_WM_SIZE()
END_MESSAGE_MAP()



// Am_AnalysisParameters_TabCtrl message handlers


and in my view class

void Am_AnalysisParameters_FormView::OnInitialUpdate()
{
	CFormView::OnInitialUpdate();
	
	
	CRect rect;
		GetWindowRect(rect);

		analysisParamTabCtrl = new Am_AnalysisParameters_TabCtrl;
		analysisParamTabCtrl->Create(TCS_TABS|WS_VISIBLE|WS_CHILD,CRect(10,10,100,100),this,12345);
}


Tomas
GeneralRe: Problem with inheritance Pin
Code-o-mat3-May-09 6:17
Code-o-mat3-May-09 6:17 
GeneralRe: Problem with inheritance Pin
Tomas(cz)3-May-09 11:04
Tomas(cz)3-May-09 11:04 
GeneralRe: Problem with inheritance Pin
Code-o-mat4-May-09 0:47
Code-o-mat4-May-09 0:47 
Questionhelp me !! Pin
Mohammadj2-May-09 8:55
Mohammadj2-May-09 8:55 
AnswerRe: help me !! Pin
Code-o-mat2-May-09 11:04
Code-o-mat2-May-09 11:04 
GeneralRe: help me !! Pin
Mohammadj3-May-09 3:28
Mohammadj3-May-09 3:28 
GeneralRe: help me !! Pin
enhzflep3-May-09 4:02
enhzflep3-May-09 4:02 
GeneralRe: help me !! Pin
Code-o-mat3-May-09 5:43
Code-o-mat3-May-09 5:43 
GeneralRe: help me !! Pin
enhzflep3-May-09 13:40
enhzflep3-May-09 13:40 
GeneralRe: help me !! Pin
Code-o-mat3-May-09 21:52
Code-o-mat3-May-09 21:52 
GeneralRe: help me !! Pin
enhzflep3-May-09 22:03
enhzflep3-May-09 22:03 
GeneralRe: help me !! Pin
Code-o-mat3-May-09 22:08
Code-o-mat3-May-09 22:08 
GeneralRe: help me !! Pin
Mohammadj6-May-09 11:16
Mohammadj6-May-09 11:16 
GeneralRe: help me !! Pin
Code-o-mat6-May-09 20:46
Code-o-mat6-May-09 20:46 
GeneralRe: help me !! Pin
Mohammadj8-May-09 10:49
Mohammadj8-May-09 10:49 
GeneralRe: help me !! Pin
Code-o-mat8-May-09 12:42
Code-o-mat8-May-09 12:42 
GeneralRe: help me !! Pin
Mohammadj9-May-09 4:55
Mohammadj9-May-09 4:55 

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.