Click here to Skip to main content
15,897,226 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi,

I am new to MFC. Please help me to call one Dialog from other dialog in Dialog based application

Thank you
Posted

C++
CSecondDialog dialog2(pszTemplateName);
int rc2 = dialog2.DoModal();

What exactly are you having a problem with?
 
Share this answer
 
This is the code.

CDlgDetect dlgDC;
if(IDOK == dlgDC.DoModal())

But I am getting Debug Assertion Failed error in dlgdata.cpp line 40

I am not able to figure out where exactly I need to give the ID of second dialog.

Please help
 
Share this answer
 
Comments
Richard MacCutchan 23-Sep-12 7:13am    
You need to pass your dialog's template ID to the constructor as I showed you. You can also use your debugger to see exactly what is happening on line 40.
Richard MacCutchan 23-Sep-12 7:14am    
Also please do not post questions as solutions. Use the comment button.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900