Is There Still A Case For MFC

2019-01-22 19:41发布

What are the compelling features of MFC? Why would you select it for a new project?

14条回答
聊天终结者
2楼-- · 2019-01-22 20:17

Here's a possibility - imagine an application that would require a large amount of memory, say a graphics program, a game or maybe some high performance business application. It's no secret that .NET applications hog memory - in such a case, you may want a lean MFC app for the core of your application. You can always load up and use .NET components, controls, etc through either COM callable wrappers or directly through C++/CLI.

That all being said - MFC is a pain. Consider WTL instead - you can still call into .NET if you need to, the same way as I mentioned above for MFC. WTL is a lot nicer than MFC :-)

查看更多
萌系小妹纸
3楼-- · 2019-01-22 20:17

The advantage of MFC is that it's still nicer than coding to bare win32 and you can distribute a native .exe that doesn't require a 23-50Mb runtime like .Net.

Now, if you're concerned about those things there are better alternatives out there: C++ Builder, WxWidgets, etc. But some places won't consider non-Microsoft tools.

查看更多
forever°为你锁心
4楼-- · 2019-01-22 20:22

I think not.. MFC would lose out in

  • Level of abstraction
  • Development Time
  • Troubleshooting time
  • Learning curve for new developers
  • Future proofing (although now that's questionable.. with something new coming up every 3-4 years)
  • Finding good people who know their MFC
  • Easy to use controls

The only place where MFC would probably sneak past is if you have some very performance intensive applications like you have things on screen that need to be redrawn every 10 msec or 1 sec. "Managed" apps still haven't managed to jump past that hurdle.

MFC was an important step in the evolution, but now better options are available.

查看更多
We Are One
5楼-- · 2019-01-22 20:24

The existing windows API is entirely C based. If you want to use C++ (and you probably should) then MFC is the logical choice if you wish to stay native (i.e. not using .NET).

MFC is just a set of object-orientated classes over the top of the C API. Plus quite a few additional "helper" classes that make it easier to do everyday tasks.

查看更多
干净又极端
6楼-- · 2019-01-22 20:24

MFC was good option 10 years ago. It is still a good wrapper over Win32 API but unfortunately obsolete.

Trolltech's QT is better option with one big advantage - it is platform independent. With MFC you're doomed to Windows.

查看更多
劫难
7楼-- · 2019-01-22 20:26

Apparently it is still a good choice for applications for windows-based hand-held devices, such as point-of-sale devices. In these, resources are limited so things like memory management become more significant.

查看更多
登录 后发表回答