Click here to Skip to main content
15,921,028 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Trying to create a log file using Notepad Pin
Nibu babu thomas25-Nov-08 2:55
Nibu babu thomas25-Nov-08 2:55 
QuestionCreate two files with the same name but different extention Pin
Member 198099925-Nov-08 2:05
Member 198099925-Nov-08 2:05 
AnswerRe: Create two files with the same name but different extention Pin
Nibu babu thomas25-Nov-08 2:24
Nibu babu thomas25-Nov-08 2:24 
GeneralRe: Create two files with the same name but different extention Pin
Member 198099925-Nov-08 2:30
Member 198099925-Nov-08 2:30 
AnswerRe: Create two files with the same name but different extention Pin
Iain Clarke, Warrior Programmer25-Nov-08 2:51
Iain Clarke, Warrior Programmer25-Nov-08 2:51 
AnswerRe: Create two files with the same name but different extention Pin
David Crow25-Nov-08 14:21
David Crow25-Nov-08 14:21 
GeneralRe: Create two files with the same name but different extention Pin
Member 198099926-Nov-08 0:30
Member 198099926-Nov-08 0:30 
Questionmultiple modaless dialogs Pin
josip cagalj25-Nov-08 1:56
josip cagalj25-Nov-08 1:56 
Hi.
I'm writing an app which can show more instances of 'CMyDlg' class.
void CMainFrame::OnSomething() 
{
CMyDlg *m_Dlg = new CMyDlg();
...//passing data
m_Dlg->Create(...);
m_Dlg->ShowWindow(...);
m_DlgPtr.AddHead(m_Dlg);//add to CPtrList member
}


When App is about to close I clean out CPtrList:

void CMainFrame::OnClose() 
{
	POSITION pos = m_DlgPtr.GetTailPosition();
	while(pos != NULL)
	{
		CMyDlg *m_Dlg = (CMyDlg *)m_DlgPtr.GetPrev(pos);
		m_Dlg->CloseWindow();
		delete m_Dlg;
	}
	
	CFrameWnd::OnClose();
}

When user closes the dialog manually (on cancel), I was thinking to send message to main frame on which I'll find appropriate dialog pointer among m_DlgPtr and delete it. My concern is how to send pointer trough message?

void CGrafQueueDlg::OnCancel() 
{
	...
	CMainFrame* pMainFrame = (CMainFrame*)AfxGetMainWnd( );
	pMainFrame->PostMessage(WM_DLG_CLOSE,?,?);//how to pass pointer to this?

	CDialog::OnCancel();
}

Thanks in advance.
AnswerRe: multiple modaless dialogs Pin
Nibu babu thomas25-Nov-08 2:21
Nibu babu thomas25-Nov-08 2:21 
GeneralRe: multiple modaless dialogs Pin
josip cagalj25-Nov-08 2:56
josip cagalj25-Nov-08 2:56 
GeneralRe: multiple modaless dialogs Pin
Rick York25-Nov-08 10:19
mveRick York25-Nov-08 10:19 
GeneralVC6 on Vista 64-Bit Pin
hairy_hats25-Nov-08 1:24
hairy_hats25-Nov-08 1:24 
GeneralRe: VC6 on Vista 64-Bit Pin
Randor 25-Nov-08 3:23
professional Randor 25-Nov-08 3:23 
Question_ftime() and leap seconds Pin
vikramlinux25-Nov-08 1:11
vikramlinux25-Nov-08 1:11 
AnswerRe: _ftime() and leap seconds Pin
David Crow25-Nov-08 14:23
David Crow25-Nov-08 14:23 
Questionfind all connect system ip address in the network Pin
Member 470867625-Nov-08 0:14
Member 470867625-Nov-08 0:14 
AnswerRe: find all connect system ip address in the network Pin
Code-o-mat25-Nov-08 5:43
Code-o-mat25-Nov-08 5:43 
GeneralRe: find all connect system ip address in the network Pin
Member 470867630-Nov-08 17:39
Member 470867630-Nov-08 17:39 
AnswerRe: find all connect system ip address in the network Pin
David Crow25-Nov-08 14:26
David Crow25-Nov-08 14:26 
GeneralRe: find all connect system ip address in the network Pin
Member 470867630-Nov-08 17:37
Member 470867630-Nov-08 17:37 
QuestionCan I disable repainting of a window? [SOLVED] Pin
sashoalm25-Nov-08 0:02
sashoalm25-Nov-08 0:02 
AnswerRe: Can I disable repainting of a window? Pin
Stephen Hewitt25-Nov-08 0:30
Stephen Hewitt25-Nov-08 0:30 
GeneralRe: Can I disable repainting of a window? Pin
sashoalm25-Nov-08 2:26
sashoalm25-Nov-08 2:26 
QuestionAccess denied problem in UAC Enable for removable media Pin
VCProgrammer25-Nov-08 0:02
VCProgrammer25-Nov-08 0:02 
QuestionBlocking recv() in worker thread or async OnReceive()? Pin
atillaselem24-Nov-08 23:07
atillaselem24-Nov-08 23:07 

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.