views:

319

answers:

2

Is is possible to draw controls using Visual C++ designer on the main window, in the same way you can design dialogs? I'd preferably like to be able to design the main window controls this way without using MFC, rather than creating them on WM_CREATE.

EDIT: I don't want a dialog-based app, just to be able to design the main window graphically similar to what can be done using Windows Forms Designer in .NET?

+1  A: 

I'm not sure if I understand what you want your app to look like. If you want your application to be a dialog, then make it a dialog app.

Just create a new MFC Application, and set it to "Dialog based". Now your application will start at that dialog.

If you want to use a native win32 app, just create the dialog in your InitInstance, using CreateDialog (instead of CreateWindow).

In both cases, you use the resource editor to create the dialog.

Simon Parker
+1  A: 

Your options are:

  • Use MFC and create a main window that has a dialog view (based on the CFormView class).
  • Use WinForms/.NET
  • Use Qt.

If you're starting a new project and you want to stick with C++, then I highly recommend Qt. Not only is it an excellent framework, but it's cross-platform so your app could be built on Linux and the Mac.

http://www.qtsoftware.com/products/

A Visual C++ plugin is available and you can design your main window visually using a tool called Qt Designer.

Rob