7

Is there any way to build graphical interfaces in the same rapid and easy way we could do in Visual Studio, but without .NET Framework? I'm looking to native Windows GUIs, so using Qt with Qt Creator is not an option (and it doesn't need to be cross-platform). Something with the Windows API using C++ would be great (not Delphi).

I mean, applications like WinSCP really have its GUIs written entirely by hand?

Community
  • 1
  • 1
Tiago
  • 159
  • 1
  • 6
  • 6
    Qt apps on Windows look pretty native to me. What exactly is the problem with using Qt? – jalf Oct 08 '11 at 14:50
  • @jalf The problem isn't just "look" native. I'm trying to find a native way. – Tiago Oct 08 '11 at 14:53
  • 1
    Qt is one of the best GUI cross-platform toolkit, and it has pretty much native look as well. – Nawaz Oct 08 '11 at 14:53
  • @Tiago: again, what is the problem with Qt? How is it not native? It's hard to answer a question when you don't explain your requirements. If everything that isn't raw Win32 is rejected as "not native", then no, you don't have any other options than writing your GUI in Win32 from scratch, by hand. – jalf Oct 08 '11 at 14:55
  • 2
    WinSCP seems to use [VCL](http://en.wikipedia.org/wiki/Visual_Component_Library). Which is basically the C++ version of what Delphi uses. – user786653 Oct 08 '11 at 14:57
  • @jalf A third-party library is not native. If there is no other way, I would vote your comment as "accepted" if it was an answer. – Tiago Oct 08 '11 at 14:59
  • 3
    @Tiago Sorry, but Qt is as native as it gets (it uses the native OS drawing and window routines under the hood). You don't get more native with MFC, which is just no option. Delve a little bit into MFC and in at least one month you will come back and ask the question if there is some library that's not a complete pain to use, believe me. – Christian Rau Oct 08 '11 at 15:15
  • 5
    @Tiago: that's a new definition of "native". Normally, it just means "not running on a virtual machine such as .NET or JVM". But if what you're asking is "is there a way, without using any tools other than the raw Win32 API, to write GUIs more easily than the raw Win32 API allows", then the answer should be obvious. – jalf Oct 08 '11 at 15:20

6 Answers6

4

Given:

  1. You don't want to use Qt
  2. You want to use Win API

The natural option is MFC. It's basically quite a thin wrapper around the Win32 UI API, but VS has an MFC UI designer that will save you a lot of work (no need to manually set the co-ordinates of controls etc.).

Eran
  • 21,632
  • 6
  • 56
  • 89
  • Thank you, eran. This looks like what I was expecting. – Tiago Oct 08 '11 at 15:06
  • 2
    There is also WTL as a lightweight MFC alternative for native GUI. – Roman R. Oct 08 '11 at 15:11
  • 1
    MFC is not native, as it's just an OO wrapper around the Win32 API. At least that seems to be the OP's definition of native when excluding Qt. – Christian Rau Oct 08 '11 at 15:17
  • 8
    MFC is not a "thin wrapper". It's a framework that completely takes over your application and forces you to structure it one specific way. It's also based on 20 year old technology and an absolute pain to use And I don't really see how it is "more native" than third party libraries. – jalf Oct 08 '11 at 15:22
4

My vote is still on Qt.

I suspect OP is really confusing "Native" with "deployable in a single binary". You can achieve this also with Qt by statically linking Qt dependencies. Contrary to popular belief, the LGPL does not prohibit this either.

Now if OP is looking for "deployable in a single super small binary" utorrent style, the answer would differ. A discussion around small binaries seems a good place to look. I would say there is a price to pay in increased development time though.

But I can't agree on Qt not being as native as say MFC.

Community
  • 1
  • 1
Imbrondir
  • 666
  • 6
  • 12
3

Another excellent option is C++Builder with the VCL. This is very similar to WinForms (whose design it clearly inspired) and much more productive than MFC in my opinion.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
3

As both Qt and MFC are wrappers around the native OS functions for managing windows and other OS utilities (that use Win32 API under the hood and look completely native) there is really no reason to consider the use of MFC over Qt, as it is not more native than Qt. Either your definition of "native" is broken or you haven't told us the whole story.

But there are a thousand reasons for considering Qt over MFC, as the latter is a complete pain to use, whereas the former is a cleanly designed, easy to use and still highly flexible library (that strives for nativity by any means possible).

The only way you might see MFC as more native is that it comes from Microsoft (the same company that developed Windows). But that doesn't make it more native. It's still a third party library. This third party worked for the same company as the party developing the Win32 API, but that doesn't make it specifically more tied to the Win32 API, as both were developed independently (and surely by different people).

Do Qt apps look and feel native under Windows?

Community
  • 1
  • 1
Christian Rau
  • 45,360
  • 10
  • 108
  • 185
2

You could also take a look at wxWidgets.

Branko Dimitrijevic
  • 50,809
  • 10
  • 93
  • 167
2

In addition to MFC, you might want to look into the Windows Template Library.

CMircea
  • 3,543
  • 2
  • 36
  • 58