PDA

Click to See Complete Forum and Search --> : Another rookie question ;o)


Zvonko
Sep 14th, 2000, 10:30 AM
Hello!

I started with VC++ and I'd need some help (greatly appreciated).
I use resources (dialogs) and I'd like to know how can I load another dialog through code 'cause I just can't figure it out. I've already looked in MSDN Library, but I found nothing useful.
Are there any MFC (and dealing with resources) tutorials? I've found some MFC tutorials, but none of them were including resources and dealing with them. Any suggestions?

parksie
Sep 14th, 2000, 02:26 PM
If you're using MFC, right-click on the dialogue in the dialogue editor, and choose ClassWizard. It should ask you if you want to make a new class for it.
For non-MFC, use the CreateDialog function:

HWND hMyDlg;
if(hMyDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_MYDIALOG), NULL, DlgProc)) {
ShowWindow(hMyDlg, SW_SHOW);
}

Where DlgProc is your Dialogue Box Procedure (see the Platform SDK).

Zvonko
Sep 15th, 2000, 12:16 PM
Thanks.

But what I really want is that:
I have created dialog (in resources) and I want to show another dialog when user presses button on my main dialog. How can I do that, 'cause I've tried something but it didn't work out anything.

parksie
Sep 15th, 2000, 01:30 PM
I'll send you an example project in a bit. You're on VC6, aren't you?

Zvonko
Sep 15th, 2000, 03:41 PM
Could you do this for me and send me an example?
I have VS6 (SP3).
My e-mail: zvonko.bostjancic@siol.net

Thanks.