views:

189

answers:

4

I'm learning C++, and know a little bit of Visual Basic and an Delphi.

But I want to know, is there some program like Delphi, but for C++. Something where you can drag a button to a form, double click it, the like in Delphi and VB: opens a code editor and you edit the code of the button, but with a similar code of C++?

I'm using Windows Vista.

+5  A: 

Yes, if you use MFC within Visual Studio.

MFC is Visual Studio's C++ class library for writing Windows programs, and for an MFC form Visual Studio behaves exactly as you describe.

As of Visual Studio 2008 with an upgrade pack you can create Office 2007 style applications, and Visual Studio style applications, using MFC.

RichieHindle
Isn't there another way to accomplish what the author is asking for avoiding the bloated MFC?
John
Good answer! MFC is strong in exactly that area; WYSIWYG dialog design and simple mapping between UI and code.However, MFC code is not idiomatic C++ and if the OP is looking to learn C++ there's probably better libraries. I don't know how the others stack up -- eg QT and wxWidgets?
Kim Gräsman
MFC is included in Visual C++ Express Edition?
Nathan Campos
@Nathan: Ah, no, MFC isn't included in Visual C++ Express Edition. I didn't know that was what you were using.
RichieHindle
Technically speaking, you don't need an MFC project to use the dialog editor - it's available in plain Win32 apps too (it just edits dialogs in resource files in that case).
Pavel Minaev
@Pavel: that's true, but you don't get that simple link between the resources and the code, "double-click to open the code editor".
RichieHindle
+4  A: 

There used to be "C++ Builder", a C++ version of Delphi, I don't know if this product is still being developed or not.

UPDATE: to summarize information from the comments, C++ Builder is actively developed and the product page is http://www.embarcadero.com/products/cbuilder/

Nir
John
Link to C++Builder product page http://www.embarcadero.com/products/cbuilder/
stukelly
A: 

There are other packages besides MFC that do GUI stuff, but I don't think they plug-in to Visual Studio. I must confess, I have never been a fan of MFC. I find it ugly and painful, so I can't really recommend it.

Qt has a designer, as does GTK. I haven't used the Qt designer, but the GTK one works well. It can be found here: http://glade.gnome.org/ You can get glade for Windows here: http://gladewin32.sourceforge.net/

It can be hassle to set these up, though.

Honestly, while I like C++ a lot, writing GUIs for Windows is not where it excels. I would recommend that you look at C# instead. You can still interface with C++ if you need to, but it makes writing Windows GUIs so much nicer.

Christopher
+1  A: 

You can have the following IDEs with GUI designers for free;

  • Visual Studio 2008 express from Microsoft
  • Qt Creator from Nokia
  • Eclipse with Qt plugin from community :)
  • C++ Builder from Embarcadero (previously CodeGear, previously Borland)

Have fun with C++!

Piotr Dobrogost