C and C++ Programming Resources

A query

Discuss simple terms about declaring a simple variable to more complex Visual C++ problems.

A query

Postby imadulhaq » Mon Mar 28, 2005 12:31 am

Hi
This is my post on this forum. My question is this that I want to create a modal dialog box say CMyDlg which is created by driving from CDialog class and I want to create it in other callback function. This callback function is also for another dialog which I created through CreateDialog() function. I can't create CMyDlg using
Dialogbox() function because this function requires a callback function which I don't need to write because all the messages are handled by CMyDlg driven through CDialog. And when I use Create() function to create the CMyDlg dialog my application terminates.

I hope you people can understand my problem and can suggest me a solution.

Thanks alot.
imadulhaq
 
Posts: 1
Joined: Mon Mar 28, 2005 12:23 am
Location: Pakistan

Postby administrator » Mon Mar 28, 2005 12:59 pm

hello,
I think there are some doubts in your question.
what i have an idea in my mind is that
You create a dialog box by calling DoModal(); let it is Dlg1
now on Dlg1 ther is a button and on its event you call Create() for Dlg2. I think it should work fine as far as you put all the header files in the cpp files where necessery.
If your problem is something else  explain it again or someone may answer it correctly.
Thanks
 
C and C++ Programming Tutorials & Source Code
http://www.mycplus.com
User avatar
administrator
 
Posts: 90
Joined: Sun Feb 22, 2004 1:42 am
Location: United Kingdom

Postby msaqib » Fri Apr 01, 2005 12:17 pm

I think your question is not clear.
I never saw any Dialogbox()  function in CDlg class or may be its an API function. but to create a dialog you should give a resource ID in the arguments of the function (i.e constructure) of the class that will create the dialog.
 
C and C++ Programming Tutorials & Source Code
http://mycplus.com
User avatar
msaqib
 
Posts: 74
Joined: Sun Feb 22, 2004 2:38 pm
Location: United Kingdom


Return to Visual C++ Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron