Click here to Skip to main content
15,925,602 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Using Braces in C++ Pin
bob169722-Jun-08 17:56
bob169722-Jun-08 17:56 
AnswerRe: Using Braces in C++ Pin
Hamid_RT3-Jun-08 1:21
Hamid_RT3-Jun-08 1:21 
Questiondll not been made Pin
prithaa2-Jun-08 2:55
prithaa2-Jun-08 2:55 
AnswerRe: dll not been made Pin
Alan Balkany2-Jun-08 3:45
Alan Balkany2-Jun-08 3:45 
GeneralRe: dll not been made Pin
prithaa2-Jun-08 3:50
prithaa2-Jun-08 3:50 
GeneralRe: dll not been made Pin
Alan Balkany2-Jun-08 3:57
Alan Balkany2-Jun-08 3:57 
AnswerRe: dll not been made Pin
Hamid_RT3-Jun-08 1:23
Hamid_RT3-Jun-08 1:23 
QuestionCommunications between dialogs Pin
Trupti Mehta2-Jun-08 2:44
Trupti Mehta2-Jun-08 2:44 
I have 7 child dialogs, & a parent dialog. From parent dialog, I call 1st child, on the child dlg's buttons child sends message to the parent. Among that one message is to update the object in parent which is working fine. The second message is to hide that child and show another child dialog.
I have added method for the message :
afx_msg LRESULT DataEntryDialog::OnSHOW_NEXT_VIEW(WPARAM wparam, LPARAM lparam) {
}

In child1 :
in .h the events are declared as
enum
{
    BASE /* not used */ = WM_USER,
    CHANGED_DS, SHOW_NEXT_VIEW,
};

void CPage1Dlg::TellParent()
{
	// Update deptStock obj with the parent
	this->CRHPostMessageToParent(CHANGED_DS, (int)&deptStock);
	this->ShowWindow(false);
	CRHPostMessageToParent(SHOW_NEXT_VIEW, 2);
}


In parent:
Childs are created as below in OnInitDialog():
CRect rect(4, 2, 5,2);
CPoint point(0, 10);

childPage1.CRHCreateGenericChildDialog(this, &rect,0, NULL);
childPage1.SetDeptStock(deptStock);

rect += point;
childPage2.CRHCreateGenericChildDialog(this, &rect, 1, NULL);
childPage2.ShowWindow(false);


childVisible = 1;

afx_msg LRESULT DataEntryDialog::OnCHANGED_DS(WPARAM wparam, LPARAM lparam)
// handles message sent up from child dialog
{
	deptStock = (DeptStock&)lparam;
	AfxMessageBox(_T("Dept Stock Updated"));
	return 0;
}

afx_msg LRESULT DataEntryDialog::OnSHOW_NEXT_VIEW(WPARAM wparam, LPARAM lparam) {
	
	int childView = (int)lparam;
	AfxMessageBox(childView);

	if (childView ==2) {
		childPage2.SetDeptStock(deptStock);
		childPage2.ShowWindow(true);
		childVisible = 2;
	}

	return 0;
}


Any guidance on the above is highly appreciated.

Thanks

Terry

AnswerRe: Communications between dialogs Pin
KarstenK2-Jun-08 2:54
mveKarstenK2-Jun-08 2:54 
GeneralRe: Communications between dialogs Pin
Trupti Mehta2-Jun-08 3:10
Trupti Mehta2-Jun-08 3:10 
AnswerRe: Communications between dialogs Pin
David Crow2-Jun-08 3:26
David Crow2-Jun-08 3:26 
AnswerRe: Communications between dialogs Pin
Jijo.Raj2-Jun-08 19:49
Jijo.Raj2-Jun-08 19:49 
GeneralRe: Communications between dialogs Pin
Trupti Mehta2-Jun-08 22:11
Trupti Mehta2-Jun-08 22:11 
GeneralRe: Communications between dialogs Pin
Jijo.Raj3-Jun-08 8:10
Jijo.Raj3-Jun-08 8:10 
GeneralRe: Communications between dialogs Pin
Trupti Mehta3-Jun-08 21:26
Trupti Mehta3-Jun-08 21:26 
GeneralRe: Communications between dialogs Pin
Jijo.Raj4-Jun-08 3:27
Jijo.Raj4-Jun-08 3:27 
QuestionConverting GUID to Hex Pin
Shivarudrayya H2-Jun-08 2:42
Shivarudrayya H2-Jun-08 2:42 
AnswerRe: Converting GUID to Hex [modified] Pin
Rajkumar R2-Jun-08 3:21
Rajkumar R2-Jun-08 3:21 
QuestionON_MESSAGE & ON_THREAD_MESSAGE Pin
thenewbee2-Jun-08 2:32
thenewbee2-Jun-08 2:32 
AnswerRe: ON_MESSAGE & ON_THREAD_MESSAGE Pin
KarstenK2-Jun-08 2:44
mveKarstenK2-Jun-08 2:44 
GeneralRe: ON_MESSAGE & ON_THREAD_MESSAGE Pin
thenewbee2-Jun-08 17:54
thenewbee2-Jun-08 17:54 
QuestionWhy does CStringArray not have a find method? Pin
Rajesh R Subramanian2-Jun-08 2:09
professionalRajesh R Subramanian2-Jun-08 2:09 
AnswerRe: Why does CStringArray not have a find method? Pin
KarstenK2-Jun-08 2:37
mveKarstenK2-Jun-08 2:37 
GeneralRe: Why does CStringArray not have a find method? Pin
Rajesh R Subramanian2-Jun-08 2:46
professionalRajesh R Subramanian2-Jun-08 2:46 
AnswerRe: Why does CStringArray not have a find method? Pin
prasad_som2-Jun-08 5:52
prasad_som2-Jun-08 5:52 

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.