Visual studio like app on MFC

Started by
17 comments, last by BlackJoker 11 years ago

Hello.

I know that new MFC has an MDI variant with VS 2008 and higher interface with almost the same features and real VS has, but I want to ask a few question regarding this:

1) Could this MFC project by default realize the same behavior for TabWindow control (central window inside app) like the real VS. I mean - that user could drag this tab window out from the main window? Or could this behavior be implemented somehow?

2) Is there some good books for MFC that describe work with MFC feature pack and MFC MDI application in particular?

Advertisement

If you use something already existing for a GUI then sooner or later (Usually 48 hours) you will get stuck with something it can't do. I would just make my own GUI framework based on a frame/panel. A tree structure can store the recursive behaviour for how it resize everything according to the window. For each panel, calculate the dimensions of each child panel and tell them to resize their children. When dragging a panel, show 5 icons on each other panel where it can be released. Move it to be a new child to that panel with it's location given by the icon that you moved it to.

Please don't use MFC for new code.

It's ancient, unsupported, non-idiomatic C++, and full of evil pitfalls and gotchas. It really needs to just go die in a corner somewhere.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

Please don't use MFC for new code.

It's ancient, unsupported, non-idiomatic C++, and full of evil pitfalls and gotchas. It really needs to just go die in a corner somewhere.

lol, took out the words right out of my mouth.

Please don't use MFC for new code.

It's ancient, unsupported, non-idiomatic C++, and full of evil pitfalls and gotchas. It really needs to just go die in a corner somewhere.

I really wish Microsoft would create an appropriate replacement for it. I always wondered why C++ didn't get some sort of WinForms library. Then again, these days things like Qt are around.

Please don't use MFC for new code.

It's ancient, unsupported, non-idiomatic C++, and full of evil pitfalls and gotchas. It really needs to just go die in a corner somewhere.

It's not that terrible. If you only want to target Windows, it's perfectly fine. MFC is structurally pretty much like wxWidgets, but I never hear people complaining about that being evil.

In fact, you can save lots of time, as the OP is attempting to do, by using some of the ready-made stuff in MFC. It's pretty easy to set up a GUI that works exactly like some common MS programs (office, VS) and be done with it.

1) I looked up your question, and it seems that it's possible to do what you want:

http://msdn.microsoft.com/en-us/library/bb983663(v=vs.90).aspx

As for 2), I guess this is pretty much it:

http://msdn.microsoft.com/en-us/library/bb982354(v=vs.90).aspx

The MFC extension pack is based on components by BCGsoft, so looking at their documentation might help a little also.

It's not that terrible.

Yes, it bloody is. Take it from someone who's worked professionally with it for over a decade.

If you only want to target Windows, it's perfectly fine.

So if you're only targeting windows, why wouldn't you use the infinitely better winforms?

MFC is structurally pretty much like wxWidgets, but I never hear people complaining about that being evil.

In fact, you can save lots of time, as the OP is attempting to do, by using some of the ready-made stuff in MFC. It's pretty easy to set up a GUI that works exactly like some common MS programs (office, VS) and be done with it.

Yes, and if you have a legacy code base that uses MFC, that is exactly what you should do. If you're writing new code, use something else and leverage the huge library of code for that.
if you think programming is like sex, you probably haven't done much of either.-------------- - capn_midnight

Yes, it bloody is. Take it from someone who's worked professionally with it for over a decade.

I'm glad that you are talking from experience. Most people who shout "MFC sucks" have never used it extensively. I used to be one of those people myself.

I have worked with it professioanlly for six years. I have alwo worked with other toolkits. They all have quirks that make them suck in some way. Often these ways of suckage are the same as in MFC. Perhaps you could elaborate on what aspects of MFC it is that you think makes it suck so much more than other toolkits?

So if you're only targeting windows, why wouldn't you use the infinitely better winforms?

There could be lots of reasons. Perhaps you want write all of your program in one language? It's not like it's an order of magnitude more difficult to use MFC than to use winforms.

Yes, and if you have a legacy code base that uses MFC, that is exactly what you should do. If you're writing new code, use something else and leverage the huge library of code for that.

I am not completely against using MFC for new projects today. It does make certain types of UI a lot easier to create than any other toolkit. Also, unlike what was claimed in this thread, MFC is just as supported as any other library that comes with Visual Studio, and it is still being actively developed. There also exists excellent third-party components (BCGsoft, CodeJock) for it that have been refined for a very long time, and contain some stuff that really doesn't exist for other toolkits.

Of course, it would not be my first choice, but if the situation and type of application is such that using MFC could save a lot of time, I would at least seriously consider it. Shipping on time is a nice feature to have.

Of course, it would not be my first choice, but if the situation and type of application is such that using MFC could save a lot of time, I would at least seriously consider it. Shipping on time is a nice feature to have.

While I agree that business concerns trumps technical concerns, I'd struggle to imagine any situation where a new project would be better written in MFC than another language/toolkit/framework. The only one I can think of would be if you were doing a small urgent project and MFC was the main skillset on your team.
if you think programming is like sex, you probably haven't done much of either.-------------- - capn_midnight

This topic is closed to new replies.

Advertisement