Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. MFC.

MFC.

Scheduled Pinned Locked Moved The Lounge
csharpc++questiondelphilinux
24 Posts 16 Posters 4 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    ROK_RShadow
    wrote on last edited by
    #1

    What is MFC so hated? I can understand why somebody programming for linux would not like MFC, I can even understand why a borland fan would not like MFC. But somebody using MSVC and programming for Windows?? That does not make sense. Not if the only thing from the MFC library you are using is a CString, Ok I can understand that. Not much sense in including the library for a CString. I understand that MFC is a little bloated. But why do developers not like MFC? I have been seeing that a lot of articles being posted (outside the .NET crap) are MFC biased. is MFC really that bad? IMHO: C# a poor attempt at bringing C++ to the VB masses

    C C M C J 10 Replies Last reply
    0
    • R ROK_RShadow

      What is MFC so hated? I can understand why somebody programming for linux would not like MFC, I can even understand why a borland fan would not like MFC. But somebody using MSVC and programming for Windows?? That does not make sense. Not if the only thing from the MFC library you are using is a CString, Ok I can understand that. Not much sense in including the library for a CString. I understand that MFC is a little bloated. But why do developers not like MFC? I have been seeing that a lot of articles being posted (outside the .NET crap) are MFC biased. is MFC really that bad? IMHO: C# a poor attempt at bringing C++ to the VB masses

      C Offline
      C Offline
      Chris Losinger
      wrote on last edited by
      #2

      i like MFC just fine. it does 66% what it tries to do. for everything else, there's the STL. -c


      Image tools: ThumbNailer, Bobber, TIFFAssembler

      J R realJSOPR 3 Replies Last reply
      0
      • C Chris Losinger

        i like MFC just fine. it does 66% what it tries to do. for everything else, there's the STL. -c


        Image tools: ThumbNailer, Bobber, TIFFAssembler

        J Offline
        J Offline
        Jorgen Sigvardsson
        wrote on last edited by
        #3

        Chris Losinger wrote: it does 66% what it tries to do It's more like 66.6% ;) -- Shine, enlighten me - shine Shine, awaken me - shine Shine for all your suffering - shine

        F 1 Reply Last reply
        0
        • R ROK_RShadow

          What is MFC so hated? I can understand why somebody programming for linux would not like MFC, I can even understand why a borland fan would not like MFC. But somebody using MSVC and programming for Windows?? That does not make sense. Not if the only thing from the MFC library you are using is a CString, Ok I can understand that. Not much sense in including the library for a CString. I understand that MFC is a little bloated. But why do developers not like MFC? I have been seeing that a lot of articles being posted (outside the .NET crap) are MFC biased. is MFC really that bad? IMHO: C# a poor attempt at bringing C++ to the VB masses

          C Offline
          C Offline
          Chris Austin
          wrote on last edited by
          #4

          ROK_RShadow wrote: IMHO: C# a poor attempt at bringing C++ to the VB masses LOL! I'd rather use C# than managed C++ anyday, the managed C++ syntax just makes me want to take a shower. Besided that, it is not like C++ is incredibly hard to master basic concepts. Hey don't worry, I can handle it. I took something. I can see things no one else can see. Why are you dressed like that? - Jack Burton

          1 Reply Last reply
          0
          • R ROK_RShadow

            What is MFC so hated? I can understand why somebody programming for linux would not like MFC, I can even understand why a borland fan would not like MFC. But somebody using MSVC and programming for Windows?? That does not make sense. Not if the only thing from the MFC library you are using is a CString, Ok I can understand that. Not much sense in including the library for a CString. I understand that MFC is a little bloated. But why do developers not like MFC? I have been seeing that a lot of articles being posted (outside the .NET crap) are MFC biased. is MFC really that bad? IMHO: C# a poor attempt at bringing C++ to the VB masses

            M Offline
            M Offline
            Maximilien
            wrote on last edited by
            #5

            The problem with MFC is that it's bound to Win32 too closely. It's only a wrapper over it, and a programmer that doesn't really know Win32 will have a harder time trying to make MFC work out of the simplistic application framework it is intended for. MFC is really great is both the programmers, client, managers know the limitations of the framework; as soone as one of the above want to make things a bit of of the MFC boundaries, hell is broke loose. Max.


            Maximilien Lincourt For success one must aquire one's self

            R 1 Reply Last reply
            0
            • C Chris Losinger

              i like MFC just fine. it does 66% what it tries to do. for everything else, there's the STL. -c


              Image tools: ThumbNailer, Bobber, TIFFAssembler

              R Offline
              R Offline
              ROK_RShadow
              wrote on last edited by
              #6

              So were are some good refrences for STL? A good beginners text or something. I started out programming C++ for DOS 6.2 with Borland.. but I never really used templates before. As far as windows programming I started with MFC.. Learing Microsoft Visual C++ 6.0 by Chuck Spar (really like that book. was easy to follow).. anyways now if I could go back, I think I would have learning the API first (I am doing that now).. but back to my question.. STL.. that is Standard Template Library correct? what is so great about templates? IMHO: C# a poor attempt at bringing C++ to the VB masses

              C N 2 Replies Last reply
              0
              • M Maximilien

                The problem with MFC is that it's bound to Win32 too closely. It's only a wrapper over it, and a programmer that doesn't really know Win32 will have a harder time trying to make MFC work out of the simplistic application framework it is intended for. MFC is really great is both the programmers, client, managers know the limitations of the framework; as soone as one of the above want to make things a bit of of the MFC boundaries, hell is broke loose. Max.


                Maximilien Lincourt For success one must aquire one's self

                R Offline
                R Offline
                ROK_RShadow
                wrote on last edited by
                #7

                I agree. It is important to know the limitations of the framework, as well as the Win32 API; because you are right. It a lot of instances MFC is just a thin wrapper for an API call. However I have seen a lot of people write things like "MFC is bad because I allways have to work around their document/view structure" I have found that the Doc/View works great for a lot of applications I write, however it is very easy, and possible to use MFC without the Doc/View stuff. Also in a lot of instances I have coded "outside" the framework of MFC, as long as you have a good general knowledge and people like Paul from MSJ programming outside of the framework isn't too complicated. :-D Of course these are limitations. I just don't understand what STL and ATL have over MFC, other than the fact that MFC is tied to the Win32 API. (but again if you are programming for windows you are using the Win32 API anyways regardless). C# a poor attempt at bringing C++ to the VB masses

                1 Reply Last reply
                0
                • R ROK_RShadow

                  So were are some good refrences for STL? A good beginners text or something. I started out programming C++ for DOS 6.2 with Borland.. but I never really used templates before. As far as windows programming I started with MFC.. Learing Microsoft Visual C++ 6.0 by Chuck Spar (really like that book. was easy to follow).. anyways now if I could go back, I think I would have learning the API first (I am doing that now).. but back to my question.. STL.. that is Standard Template Library correct? what is so great about templates? IMHO: C# a poor attempt at bringing C++ to the VB masses

                  C Offline
                  C Offline
                  Chris Losinger
                  wrote on last edited by
                  #8

                  there are a hundred STL books out there. but i don't know much about them. i learned the STL the old-fashioned way: by being thrown into a project that used it. the best place to start with STL (in my opinion) is with the containers: vector, map, list, etc.. they crush MFC's container classes. i think there are a few tutorials on Code Project dealing with the containers. templates rule. they really open up a whole new world of programming possibilities. like what...? umm. well, they're the basis for the STL container classes, for one. so, the people who wrote std::vector only had to write it once, and it will work for any data type you can throw at it. -c


                  Image tools: ThumbNailer, Bobber, TIFFAssembler

                  1 Reply Last reply
                  0
                  • R ROK_RShadow

                    What is MFC so hated? I can understand why somebody programming for linux would not like MFC, I can even understand why a borland fan would not like MFC. But somebody using MSVC and programming for Windows?? That does not make sense. Not if the only thing from the MFC library you are using is a CString, Ok I can understand that. Not much sense in including the library for a CString. I understand that MFC is a little bloated. But why do developers not like MFC? I have been seeing that a lot of articles being posted (outside the .NET crap) are MFC biased. is MFC really that bad? IMHO: C# a poor attempt at bringing C++ to the VB masses

                    C Offline
                    C Offline
                    Chris Maunder
                    wrote on last edited by
                    #9

                    Like any tool MFC is an excellent library as long as it's used correctly. Developers often disparage is because it's large (I guess .NET has reset the bar on that argument), or unweildy, or not sufficiently object oriented, or doesn't provide enough control where control is needed, or all manner of other things. If you want to get a Windows app up and running - complete with toolbars, printing support and serialisation then you can't go past MFC, but if you don't need that then ATL (and subsequently WTL) or STL can be an excellent alternative provided you are willing to work with templates. MFC isn't what you would want to use if writing a lightweight ActiveX control, or a numerical methods library (though I'll admit I'm guilty of the latter), but it can save a hell of a lot of time, and at least provide a robust framework within which you can embed components using other libraries written using libraries best suited to that task. The whole "I don't like technology XYZ" seems, to me at least, to often mean "I don't like technology XYZ when writing apps best suited to being developed using technology ABC". cheers, Chris Maunder

                    N 1 Reply Last reply
                    0
                    • J Jorgen Sigvardsson

                      Chris Losinger wrote: it does 66% what it tries to do It's more like 66.6% ;) -- Shine, enlighten me - shine Shine, awaken me - shine Shine for all your suffering - shine

                      F Offline
                      F Offline
                      Frank Liao
                      wrote on last edited by
                      #10

                      Jörgen Sigvardsson wrote: It's more like 66.6% If you round it to the nearest 100th, then it would be 66.67%;P Frank http://www.frankliao.com

                      J 1 Reply Last reply
                      0
                      • R ROK_RShadow

                        What is MFC so hated? I can understand why somebody programming for linux would not like MFC, I can even understand why a borland fan would not like MFC. But somebody using MSVC and programming for Windows?? That does not make sense. Not if the only thing from the MFC library you are using is a CString, Ok I can understand that. Not much sense in including the library for a CString. I understand that MFC is a little bloated. But why do developers not like MFC? I have been seeing that a lot of articles being posted (outside the .NET crap) are MFC biased. is MFC really that bad? IMHO: C# a poor attempt at bringing C++ to the VB masses

                        J Offline
                        J Offline
                        Jim A Johnson
                        wrote on last edited by
                        #11

                        It's primarily becasue it's old, and not designed very well by today's standards. Beyond that I haven't seen any valid criticisms of it. There's also this notion that MFC imposes a huge runtime penalty because of the need to carry a lot of DLLs around, but that's nonsense. When statically linked, MFC apps are reasonably sized.

                        R 1 Reply Last reply
                        0
                        • J Jim A Johnson

                          It's primarily becasue it's old, and not designed very well by today's standards. Beyond that I haven't seen any valid criticisms of it. There's also this notion that MFC imposes a huge runtime penalty because of the need to carry a lot of DLLs around, but that's nonsense. When statically linked, MFC apps are reasonably sized.

                          R Offline
                          R Offline
                          ROK_RShadow
                          wrote on last edited by
                          #12

                          but isn't it true that most Microsoft apps use these same DLL's ?? So chances are if you dynamicly link to the Library .. the end user most likely has the release builds of the DLL's allready on their machine. -------------------------------------------------------- IMHO: C# a poor attempt at bringing C++ to the VB masses --------------------------------------------------------

                          R 1 Reply Last reply
                          0
                          • R ROK_RShadow

                            What is MFC so hated? I can understand why somebody programming for linux would not like MFC, I can even understand why a borland fan would not like MFC. But somebody using MSVC and programming for Windows?? That does not make sense. Not if the only thing from the MFC library you are using is a CString, Ok I can understand that. Not much sense in including the library for a CString. I understand that MFC is a little bloated. But why do developers not like MFC? I have been seeing that a lot of articles being posted (outside the .NET crap) are MFC biased. is MFC really that bad? IMHO: C# a poor attempt at bringing C++ to the VB masses

                            N Offline
                            N Offline
                            Navin
                            wrote on last edited by
                            #13

                            There are good and bad things about MFC. The good things are that it's relatievly easy to use if you don't go "outside the box", or want to get something up and runing quickly. Here are the things I don't like about MFC: :bob: Message maps. If you can do all your message maps with the wizard, you are golden. But when you have to write custom ones, it sucks big time. You have to look up the proper line to put in your message map (it is NEVER intuitive), and if you get it wrong, your app will mysteriously crash in release mode. As a comparison, I've also used wxWindows, and its message maps are much easier. For instance, all keyboard events expect a wxKeyEent object, etc. :bob: As others have said, it's tied very closely to Win32. This is cool if all you want to do is write apps that use regular Windows controls and will never be ported to other platforms.. but not all of us want to be that tied down. :bob: The collection classes suck compaired to STL. When first looking at STL it seemed kind of confusing and complicated, but once I actually started using it, I found out quickly why they did a lot of the things they did. Code beocmes much more compact and easier to follow, you haev to take fewer unnecessary steps. :bob: MFC serialization is evil, but don't get me started on thjat. :) All in all, I use MFC if I need to get something out the door quickly... or if it is temporary code... or to maintain old code. For any new real projects, I try to avoid it, though. You can pick your friends, and you can pick your nose, but you can't pick your friend's nose.

                            1 Reply Last reply
                            0
                            • R ROK_RShadow

                              but isn't it true that most Microsoft apps use these same DLL's ?? So chances are if you dynamicly link to the Library .. the end user most likely has the release builds of the DLL's allready on their machine. -------------------------------------------------------- IMHO: C# a poor attempt at bringing C++ to the VB masses --------------------------------------------------------

                              R Offline
                              R Offline
                              Rob Manderson
                              wrote on last edited by
                              #14

                              If you follow that you're really hoping the end user has the 'right' set of release DLL's. Unfortunately there are dozens of different versions of release DLL's hanging about out there and some have slight incompatibilities. Worse, if your install blindly installs 'your' set of release DLL's over the users existing set of DLL's you run the risk of breaking their other applications. MFC DLL's became a mess and most of the folk I know or have worked with who use MFC also use static linking to avoid the problems. Rob Manderson http://www.mindprobes.net

                              1 Reply Last reply
                              0
                              • R ROK_RShadow

                                What is MFC so hated? I can understand why somebody programming for linux would not like MFC, I can even understand why a borland fan would not like MFC. But somebody using MSVC and programming for Windows?? That does not make sense. Not if the only thing from the MFC library you are using is a CString, Ok I can understand that. Not much sense in including the library for a CString. I understand that MFC is a little bloated. But why do developers not like MFC? I have been seeing that a lot of articles being posted (outside the .NET crap) are MFC biased. is MFC really that bad? IMHO: C# a poor attempt at bringing C++ to the VB masses

                                C Offline
                                C Offline
                                Christian Graus
                                wrote on last edited by
                                #15

                                ROK_RShadow wrote: IMHO: C# a poor attempt at bringing C++ to the VB masses Do you realise that this statement is as bigoted as the statements by people who blanket hate MFC ? Christian NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma Anonymous wrote: OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window. I think you are a good candidate for Visual Basic. - Nemanja Trifunovic

                                R 1 Reply Last reply
                                0
                                • C Chris Maunder

                                  Like any tool MFC is an excellent library as long as it's used correctly. Developers often disparage is because it's large (I guess .NET has reset the bar on that argument), or unweildy, or not sufficiently object oriented, or doesn't provide enough control where control is needed, or all manner of other things. If you want to get a Windows app up and running - complete with toolbars, printing support and serialisation then you can't go past MFC, but if you don't need that then ATL (and subsequently WTL) or STL can be an excellent alternative provided you are willing to work with templates. MFC isn't what you would want to use if writing a lightweight ActiveX control, or a numerical methods library (though I'll admit I'm guilty of the latter), but it can save a hell of a lot of time, and at least provide a robust framework within which you can embed components using other libraries written using libraries best suited to that task. The whole "I don't like technology XYZ" seems, to me at least, to often mean "I don't like technology XYZ when writing apps best suited to being developed using technology ABC". cheers, Chris Maunder

                                  N Offline
                                  N Offline
                                  Navin
                                  wrote on last edited by
                                  #16

                                  The whole "I don't like technology XYZ" seems, to me at least, to often mean "I don't like technology XYZ when writing apps best suited to being developed using technology ABC". I agree. Though Microsoft often has the tendency to push technology or frameworks on people, even when they aren't necessarily the best fit. You can pick your friends, and you can pick your nose, but you can't pick your friend's nose.

                                  1 Reply Last reply
                                  0
                                  • R ROK_RShadow

                                    What is MFC so hated? I can understand why somebody programming for linux would not like MFC, I can even understand why a borland fan would not like MFC. But somebody using MSVC and programming for Windows?? That does not make sense. Not if the only thing from the MFC library you are using is a CString, Ok I can understand that. Not much sense in including the library for a CString. I understand that MFC is a little bloated. But why do developers not like MFC? I have been seeing that a lot of articles being posted (outside the .NET crap) are MFC biased. is MFC really that bad? IMHO: C# a poor attempt at bringing C++ to the VB masses

                                    M Offline
                                    M Offline
                                    Marc Clifton
                                    wrote on last edited by
                                    #17

                                    MFC promotes bad coding practices. It is not a framework suiteable for large projects because the compile times are very long as a result of class definition interdependencies. It does not provide a framework/toolset in which to avoid this, leaving even the experienced programmer unaware of these problems until it's too late. Often, it gets in the way of doing anything custom or unique. One of my favorite examples is that the framework asserts if you don't create an application with three top level menu items, because Microsoft wants to enforce the "File/Edit/View" menu design. It also does not provide any implementation for a lot of the "cool" GUI features that are present in Microsoft's own applications, requiring that you invest additional $$$ in third party toolkits or problematic freeware. Among other things, it also reduces code re-use by making it too easy to embed what should be "business logic" within GUI event handlers. It promotes product "rigidity" because unaware programmers will not properly seperate business logic from application logic, for example, by embedding database I/O and SQL statements directly in application code. Yes. It really is that bad. A framework should have it's equivalent of the Hippocratic Oath: "first, do no harm". MFC does considerable harm to the inexperienced programmer. Marc Help! I'm an AI running around in someone's f*cked up universe simulator.
                                    Sensitivity and ethnic diversity means celebrating difference, not hiding from it. - Christian Graus
                                    Every line of code is a liability - Taka Muraoka
                                    Microsoft deliberately adds arbitrary layers of complexity to make it difficult to deliver Windows features on non-Windows platforms--Microsoft's "Halloween files"

                                    R 1 Reply Last reply
                                    0
                                    • C Christian Graus

                                      ROK_RShadow wrote: IMHO: C# a poor attempt at bringing C++ to the VB masses Do you realise that this statement is as bigoted as the statements by people who blanket hate MFC ? Christian NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma Anonymous wrote: OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window. I think you are a good candidate for Visual Basic. - Nemanja Trifunovic

                                      R Offline
                                      R Offline
                                      ROK_RShadow
                                      wrote on last edited by
                                      #18

                                      LOL, Absolutly. But hey.. I'm human right? I didn't say anything was wrong with people that don't like MFC. I just wanted to know why. :rolleyes:

                                      1 Reply Last reply
                                      0
                                      • M Marc Clifton

                                        MFC promotes bad coding practices. It is not a framework suiteable for large projects because the compile times are very long as a result of class definition interdependencies. It does not provide a framework/toolset in which to avoid this, leaving even the experienced programmer unaware of these problems until it's too late. Often, it gets in the way of doing anything custom or unique. One of my favorite examples is that the framework asserts if you don't create an application with three top level menu items, because Microsoft wants to enforce the "File/Edit/View" menu design. It also does not provide any implementation for a lot of the "cool" GUI features that are present in Microsoft's own applications, requiring that you invest additional $$$ in third party toolkits or problematic freeware. Among other things, it also reduces code re-use by making it too easy to embed what should be "business logic" within GUI event handlers. It promotes product "rigidity" because unaware programmers will not properly seperate business logic from application logic, for example, by embedding database I/O and SQL statements directly in application code. Yes. It really is that bad. A framework should have it's equivalent of the Hippocratic Oath: "first, do no harm". MFC does considerable harm to the inexperienced programmer. Marc Help! I'm an AI running around in someone's f*cked up universe simulator.
                                        Sensitivity and ethnic diversity means celebrating difference, not hiding from it. - Christian Graus
                                        Every line of code is a liability - Taka Muraoka
                                        Microsoft deliberately adds arbitrary layers of complexity to make it difficult to deliver Windows features on non-Windows platforms--Microsoft's "Halloween files"

                                        R Offline
                                        R Offline
                                        ROK_RShadow
                                        wrote on last edited by
                                        #19

                                        I can't agree with your whole statment. I have replaced the File/Edit/View menu a lot of times, and in some cases have removed the menu all together from my SDI apps. Where you talk about the "cool" GUI features I have seen almost is not all of those features implemented using MFC.. (Do you read MSJ? errr.. MSDN mag now). As far as seperating buisness logic from application logic. I don't belive this has much to do with the framework, but more of programming style. The way I design my apps, in most cases I design my classes and libraries and keep those logics very seperate, however there are instances were I will agree, I have had to change things to get my ideas to work withing the framework. IMHO: C# a poor attempt at bringing C++ to the VB masses

                                        1 Reply Last reply
                                        0
                                        • R ROK_RShadow

                                          So were are some good refrences for STL? A good beginners text or something. I started out programming C++ for DOS 6.2 with Borland.. but I never really used templates before. As far as windows programming I started with MFC.. Learing Microsoft Visual C++ 6.0 by Chuck Spar (really like that book. was easy to follow).. anyways now if I could go back, I think I would have learning the API first (I am doing that now).. but back to my question.. STL.. that is Standard Template Library correct? what is so great about templates? IMHO: C# a poor attempt at bringing C++ to the VB masses

                                          N Offline
                                          N Offline
                                          Neville Franks
                                          wrote on last edited by
                                          #20

                                          ROK_RShadow wrote: So were are some good refrences for STL? "The C++ Standard Library - A Tutorial and Refrence" by Nicolai M. Josuttis. Published by Addison Wesley. Best book by far IMHO. Mr. Josuttis has also just coauthored a book on C++ Templates which I bought last week, and it looks good as well. Neville Franks, Author of ED for Windows. www.getsoft.com Make money with our new Affilate program

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups