Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to open dialog box from a single document?

Status
Not open for further replies.

Larree

Programmer
Dec 31, 2002
20
SG
Hi,
I am a new user in Visual C++ 6.0.Using MFC, I created a single document application. From the application I wish to click a button to open a dialog box. The following is the code I used:

void CTest1Doc::OnButton1()
{
TestDlg testdlg;
int result = testdlg.DoModal():
}

It seems that it keeps looping and the dialog box IDC_TestDlg did not appear. Please advice.%-)
 
I can't understand why this would keep 'looping'???? If the dialog is no appearing is it because you have the dialog marked as 'invisible' in the resource editor. Or perhaps you have somehow changed the dialog resource ID so the program is looking for an invalid resource ID to create the dialog with?
tellis.gif

[sup]programmer (prog'ram'er), n A hot-headed, anorak wearing, pimple-faced computer geek.[/sup]​
 

Hi qednick,
I am juz assuming it is looping because when I run the exe file, the window opens. Then when I click the button to open the dialog testdlg, the whole window hangs and I have to alt+ctrl+delete to end the program.I have checked and found that the resource ID is valid. But I do not not know how to check the resource editor. Is it the properties of the dialog box? The condition for the dialog properties is blank so I dun think I put it as invisible. Is there any other possible reasons for the condition that I am facing?but it is true that the dialog is not appearing.
Thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top