Click here to Skip to main content
15,914,013 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Urgent: Help Me!!! Pin
CPallini24-Nov-06 8:50
mveCPallini24-Nov-06 8:50 
QuestionHow to use large cursor? Pin
includeh1024-Nov-06 4:12
includeh1024-Nov-06 4:12 
AnswerRe: How to use large cursor? Pin
Waldermort24-Nov-06 4:26
Waldermort24-Nov-06 4:26 
GeneralRe: How to use large cursor? Pin
includeh1024-Nov-06 9:09
includeh1024-Nov-06 9:09 
GeneralRe: How to use large cursor? Pin
Waldermort24-Nov-06 9:36
Waldermort24-Nov-06 9:36 
QuestionCall ctor in place of function argument Pin
Mr.Brainley24-Nov-06 2:23
Mr.Brainley24-Nov-06 2:23 
AnswerRe: Call ctor in place of function argument Pin
CPallini24-Nov-06 2:41
mveCPallini24-Nov-06 2:41 
Questionresizing problem in a selfmade MDIChildFrame Pin
Franken24-Nov-06 1:48
Franken24-Nov-06 1:48 
Hi all,

I've written an MFC MDI application where I need an additional child frame to show other aspects of my data. So I derived a class from CMDIChildWnd and created the Icon, Accelerator and Menu. My view for this child frame is derived from CFormView and has a chart control an a button control.

I call/create the child frame by choosing a menu entry as follows:

<br />
void CmyApp::OnAnsichtnewView()<br />
{<br />
	// TODO: Fügen Sie hier Ihren Befehlsbehandlungscode ein.<br />
	CMainFrame *pFrame = STATIC_DOWNCAST(CMainFrame, m_pMainWnd);<br />
	pFrame->CreateNewChild(RUNTIME_CLASS(CmyChildFrm), IDR_myTYPE);<br />
<br />
	CRect cr;<br />
	pFrame->GetActiveFrame()->GetClientRect(cr);<br />
<br />
	CDocument *pDoc = pFrame->GetActiveDocument();<br />
	CRuntimeClass *pRTC = RUNTIME_CLASS(CmyFromView);<br />
	CCreateContext context;<br />
	context.m_pCurrentDoc = pDoc;<br />
	context.m_pNewViewClass = pRTC;<br />
	context.m_pLastView = NULL;<br />
<br />
	pFrame->GetActiveFrame()->CreateView(&context);<br />
}<br />


In my view class I've overwritten the OnSize method as follows:

<br />
void CmyFormView::OnSize(UINT nType, int cx, int cy)<br />
{<br />
	CFormView::OnSize(nType, cx, cy);<br />
<br />
	// TODO: Fügen Sie hier Ihren Meldungsbehandlungscode ein.<br />
	if(m_Chart.GetSafeHwnd() != NULL)<br />
	{<br />
		m_Chart.MoveWindow(0, 0, cx-30, cy);<br />
	        AfxMessageBox("Chart resized");<br />
	}<br />
	if(m_Button.GetSafeHwnd())<br />
        {<br />
		m_Button.MoveWindow(cx-30, 0, 30, 30);<br />
                AfxMessageBox("Button resized");<br />
        }<br />
        AfxMessageBox("Form resized");<br />
}<br />


When I run my programm and do a resize on my new child, I only get a "Form resized" MessageBox. So, obviously m_Chart and m_Button don't get a Hwnd but I don't know why.

Can anybody give me a hint on this?

Thanks,
Frank.
Answer[Off Topic] &lt;pre&gt; Pin
toxcct24-Nov-06 2:13
toxcct24-Nov-06 2:13 
AnswerRe: resizing problem in a selfmade MDIChildFrame Pin
Viorel.24-Nov-06 2:26
Viorel.24-Nov-06 2:26 
GeneralRe: resizing problem in a selfmade MDIChildFrame [modified] Pin
Franken25-Nov-06 1:27
Franken25-Nov-06 1:27 
QuestionProblem renaming ADO's EOF [modified] Pin
narayanagvs24-Nov-06 1:29
narayanagvs24-Nov-06 1:29 
QuestionHow to export a CDialog derived class from a DLL Pin
NILANKARAJA24-Nov-06 1:26
NILANKARAJA24-Nov-06 1:26 
AnswerRe: How to export a CDialog derived class from a DLL Pin
Mark Salsbery24-Nov-06 6:14
Mark Salsbery24-Nov-06 6:14 
QuestionKeyBoard HOOK Pin
priyank_ldce24-Nov-06 1:03
priyank_ldce24-Nov-06 1:03 
AnswerRe: KeyBoard HOOK Pin
CPallini24-Nov-06 1:33
mveCPallini24-Nov-06 1:33 
AnswerRe: KeyBoard HOOK Pin
Rajesh R Subramanian24-Nov-06 2:09
professionalRajesh R Subramanian24-Nov-06 2:09 
QuestionEnumDisplaySettings API [modified] Pin
Bala Indian24-Nov-06 0:36
Bala Indian24-Nov-06 0:36 
AnswerRe: EnumDisplaySettings API Pin
Rajesh R Subramanian24-Nov-06 2:16
professionalRajesh R Subramanian24-Nov-06 2:16 
AnswerRe: EnumDisplaySettings API Pin
Bala Indian26-Nov-06 18:59
Bala Indian26-Nov-06 18:59 
QuestionBuild Count Pin
Waldermort24-Nov-06 0:13
Waldermort24-Nov-06 0:13 
QuestionTransfering an exe file . How ? Pin
Sakthiu23-Nov-06 23:57
Sakthiu23-Nov-06 23:57 
AnswerRe: Transfering an exe file . How ? Pin
Galatei24-Nov-06 1:43
Galatei24-Nov-06 1:43 
AnswerRe: Transfering an exe file . How ? Pin
Mark Salsbery24-Nov-06 6:19
Mark Salsbery24-Nov-06 6:19 
Questionhow can we retrieve selection state of listcontrol Pin
johnalek23-Nov-06 23:50
johnalek23-Nov-06 23:50 

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.