Can I show a Dialog in console program ?

K

Kid

Hi

I would like to show a GUI CDialog in Win32 console program , is it possible ?

I do not want to launch another Windows GUI program .

How can I implement it or where to find the sample code ?

Thank you .
 
B

Ben Voigt [C++ MVP]

Programs marked as console subsystem can show GUI (and programs marked as
GUI subsystem can use console windows, they just don't get one
automatically).

You'll need a message loop if you want to display anything except a modal
dialog.

By CDialog I guess you're thinking about MFC? That will make things more
difficult, and the proper newsgroup for non-.NET C++ questions is
microsoft.public.vc.language, for GUI questions like this then
microsoft.public.win32.programmer.user might be better.

I'd suggest forgetting CDialog and using the Win32 DialogBox() function if
you need just one simple dialog box. You use the same dialog box editor but
write your own dialog box procedure. The problem with CDialog is you need
to set up a bunch of MFC stuff, like a CWinApp-derived class, first. If
your dialog is more complicated, then WTL is probably the way to go (still
simpler setup than MFC).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top