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

C / C++ / MFC

 
GeneralRe: Help needed about help (2) Pin
Niklas L18-Aug-10 5:26
Niklas L18-Aug-10 5:26 
JokeRe: Help needed about help (2) Pin
Moak18-Aug-10 5:31
Moak18-Aug-10 5:31 
JokeRe: Help needed about help (2) Pin
Niklas L18-Aug-10 5:40
Niklas L18-Aug-10 5:40 
GeneralRe: Help needed about help (2) Pin
Rick York18-Aug-10 6:57
mveRick York18-Aug-10 6:57 
GeneralRe: Help needed about help (2) Pin
Niklas L18-Aug-10 7:49
Niklas L18-Aug-10 7:49 
GeneralRe: Help needed about help (2) Pin
Rick York19-Aug-10 20:17
mveRick York19-Aug-10 20:17 
GeneralRe: Help needed about help (2) Pin
Niklas L19-Aug-10 23:15
Niklas L19-Aug-10 23:15 
QuestionHow to update the CMDIView window in the mode dialog? Pin
wangningyu17-Aug-10 23:45
wangningyu17-Aug-10 23:45 
Hello everyone !

The test dialog will showing ,when the mouse double clicked on the MDIView.

Now I want to get the CMDIView's pointer in test dialog member function,and then to call "CMDIView::OnDraw" to update the windows.

the code like this:

/////////////////////////////////////////////////////////////////
// MDIView.h

#include "TestDlg.h"

class CMDIView : public CView
{
public:
CTestDlg *m_pTestDlg;
CWnd *m_pWnd;
}

CMDIView::CMDIView()
{
m_pTestDlg = new CTestDlg();
m_pTestDlg.Create(IDD_TEST_DLG,this);
m_pTestDlg.ShowWindow(SW_HIDE);
m_pTestDlg.UpdateWindow();
}

void CMDIView::OnLButtonDblClk(UINT nFlags, CPoint point)
{
m_pTestDlg.InitDlg("Hello",this);
m_pTestDlg.ShowWindow(SW_SHOWNORMAL);
}

CMDIView::OnDraw(CDC *pDC)
{
//Here will get the document pointer to draw the element.
GetDocument()->DrawAllItem(..);
}
// MDIView.h over.
/////////////////////////////////////////////////////////////////


now here is the dialog's member function:

/////////////////////////////////////////////////////////////////
class CTestDlg : public CDialog
{
public:
CWnd *m_pWnd;
//......
}

CTestDlg::InitDlg(CString strTitle,CWnd *pWnd)
{
SetWindowText(strTitle);
m_pWnd = pWnd;
ASSERT( m_pWnd != NULL);
}

void CTestDlg::OnBtnEdit()
{
//Now I want to get the CMDIView's pointer,and then to call CMDIView::OnDraw
//Then how to write?
......
}

I try to use this way ,but failed too,please help me...

m_pWnd->Invalidate();
m_pWnd->UpdateData(FALSE);


Thanks for you reply !

Best Regards !
AnswerRe: How to update the CMDIView window in the mode dialog? Pin
Eugen Podsypalnikov18-Aug-10 0:04
Eugen Podsypalnikov18-Aug-10 0:04 
GeneralRe: How to update the CMDIView window in the mode dialog? Pin
wangningyu18-Aug-10 0:07
wangningyu18-Aug-10 0:07 
QuestionGet Application Window Handle from mouse click, C++ Pin
arthur89kim17-Aug-10 23:36
arthur89kim17-Aug-10 23:36 
AnswerRe: Get Application Window Handle from mouse click, C++ Pin
goorley18-Aug-10 0:31
goorley18-Aug-10 0:31 
GeneralRe: Get Application Window Handle from mouse click, C++ Pin
arthur89kim18-Aug-10 6:12
arthur89kim18-Aug-10 6:12 
QuestionGDIplus Pin
john563217-Aug-10 23:14
john563217-Aug-10 23:14 
AnswerRe: GDIplus PinPopular
Nuri Ismail17-Aug-10 23:26
Nuri Ismail17-Aug-10 23:26 
GeneralRe: GDIplus [modified] Pin
john563218-Aug-10 0:29
john563218-Aug-10 0:29 
GeneralRe: GDIplus Pin
Nuri Ismail18-Aug-10 1:17
Nuri Ismail18-Aug-10 1:17 
GeneralRe: GDIplus Pin
Henri Socha16-Dec-10 10:14
Henri Socha16-Dec-10 10:14 
AnswerRe: GDIplus Pin
CPallini17-Aug-10 23:32
mveCPallini17-Aug-10 23:32 
QuestionMessage Removed Pin
17-Aug-10 22:58
edward barbu17-Aug-10 22:58 
QuestionRe: Question about IOleObject::GetClipboardData Pin
Cool_Dev17-Aug-10 23:43
Cool_Dev17-Aug-10 23:43 
QuestionCode-Generation Setting Pin
gothic_coder17-Aug-10 22:32
gothic_coder17-Aug-10 22:32 
AnswerRe: Code-Generation Setting Pin
ShilpiP18-Aug-10 1:09
ShilpiP18-Aug-10 1:09 
GeneralRe: Code-Generation Setting Pin
gothic_coder18-Aug-10 1:16
gothic_coder18-Aug-10 1:16 
GeneralRe: Code-Generation Setting Pin
ShilpiP18-Aug-10 1:17
ShilpiP18-Aug-10 1:17 

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.