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. Why do MFC programmers love dialog based apps so much?

Why do MFC programmers love dialog based apps so much?

Scheduled Pinned Locked Moved The Lounge
csharpc++htmlcomquestion
55 Posts 24 Posters 60 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.
  • M Marc Clifton

    Maybe because with an SDI app you have screw around with a derived CFrameWnd, a derived CFormView, and deal with the idiotic (in my opinion) document/view architecture, either ignoring it (which isn't easy, BTW) or using it (which isn't smart, in my book), whereas a CDialog is simpler because MFC and the high school kids that wrote it don't get as much in the way of doing what you really want to do, which is get something working, instead of cursing at Microsoft's subversive plot to bog all programmers down in the quagmire of MFC while they (Microsoft) take over the world writing code in Pascal??? http://www.pseudodictionary.com/ramblerant[^] :-D 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"

    Y Offline
    Y Offline
    Yuriy Zabroda
    wrote on last edited by
    #38

    What idiotic in document/view architecture? Please enlighten.

    1 Reply Last reply
    0
    • J Jorgen Sigvardsson

      Rob Manderson wrote: Thing is, the source code is there, the headers are certainly there, why not take a look sometimes? There's no "grep cult" in the Windows community. :) -- Some of them wants to abuse you Some of the wants to be abused by you

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

      How did you know that deep in my past I had some Unix experience? ;) But seriously, I'm writing applications based on someone's framework. If they provide the source code doesn't it make sense to have a look at the quality of the code? If they don't provide the source code at least let's look at all the constants and see if they missed something in the docs that maybe I need to know about ;) Rob Manderson http://www.mindprobes.net

      R J 2 Replies Last reply
      0
      • R Rob Manderson

        How did you know that deep in my past I had some Unix experience? ;) But seriously, I'm writing applications based on someone's framework. If they provide the source code doesn't it make sense to have a look at the quality of the code? If they don't provide the source code at least let's look at all the constants and see if they missed something in the docs that maybe I need to know about ;) Rob Manderson http://www.mindprobes.net

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

        After posting I had some further thoughts. If you've looked at any of my code (hint, lex and yacc demo) you'll see that I do a LOT of ASSERT and ASSERT_KINDOF tests, and AfxIsValidString etc kind of tests throughout the my code. Rarely do I hit a case when the tests fail on code that I wrote that uses code that I wrote because my mind is in that problem space. But if I'm calling a function someone else wrote then by definition my mind isn't in the exact same problem space as the author of that function. So I look at what they wrote and more importantly what they're validating about what I pass as arguments. Do they trust me as a caller? Do they expect me to pass a buffer to which they'll write yet not require I pass the size of the buffer (and make damn sure they don't overwrite my buffer)? You can bracket calls to code with exception handling all you like but if the third party function you're calling does stupid things then you must expect to suffer from unexpected side-effects and odd bugs. Overall, by that standard, I think MFC does a pretty good job of protecting me from my own assumptions about their framework. Rob Manderson http://www.mindprobes.net

        1 Reply Last reply
        0
        • N Nish Nishant

          .S.Rod. wrote: - WIN32-style app programming heritage How so? I dont think Win32/SDK coding was dialog-oriented at all! .S.Rod. wrote: fear that the CView-derived objects are such odd objects that it removes a lot of freedom This is a very likely reason. .S.Rod. wrote: MSDN doesn't make clear enough the fact that the CView class derives CWnd Oh! I never noticed that. I always took for granted that everyone would assume CWnd inheritance for CView, CDialog etc... Nish


          Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

          S Offline
          S Offline
          Stephane Rodriguez
          wrote on last edited by
          #41

          Nishant S wrote: How so? I dont think Win32/SDK coding was dialog-oriented at all! Not strictly speaking, but what you end up to very often is a mere ::DialogBoxParam() function call with a reference to the .rc dlg template, which is more or less what we do with a CDialog-based app. Nishant S wrote: Oh! I never noticed that. I always took for granted that everyone would assume CWnd inheritance for CView, CDialog etc... If I were a dev lead, I would prevent anyone from writing serious MFC code before they have read and learned Charles'Petzold bible. Unfortunately, in this mad software industry, it's more about in how little time you get that damn popup box ready, rather than writing a popup able to accomodate further requirements (especially changing specs! :(( ).

          1 Reply Last reply
          0
          • R Ryan Binns

            Haven't you noticed that the Windows API uses the Pascal calling convention? It must be because Windows is written in Pascal... :P Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)

            C Offline
            C Offline
            ColinDavies
            wrote on last edited by
            #42

            You are beginning to really scare me now. :-) Regardz Colin J Davies

            Sonork ID 100.9197:Colin

            Warning Link to the minion's animation, do not use. It's a real shame that people as stupid as you can work out how to use a computer. said by Christian Graus in the Soapbox

            1 Reply Last reply
            0
            • C ColinDavies

              Heh I agreed with every thing up till the last line !! Pascal ?? I hope you are not serious ? Regardz Colin J Davies

              Sonork ID 100.9197:Colin

              Warning Link to the minion's animation, do not use. It's a real shame that people as stupid as you can work out how to use a computer. said by Christian Graus in the Soapbox

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

              Windows 3.1 was written in Pascal, I believe. Other than that, yes, I was kidding! 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"

              1 Reply Last reply
              0
              • N Nish Nishant

                Rob Manderson wrote: Gee Marc, tell us what you really think LOL Rob, I think you just silenced the un-silencable Marc Clifton. Nish


                Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

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

                No, I went to bed. :-D 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"

                1 Reply Last reply
                0
                • C Chris Maunder

                  Poor planning. cheers, Chris Maunder

                  realJSOPR Offline
                  realJSOPR Offline
                  realJSOP
                  wrote on last edited by
                  #45

                  I think it could also be blamed on a combination of feature creep, available time remaining on the schedule, and management not wanted to admit they were wrong about the initial design and that the programmer writing the app was right all along. You may think I'm being a bit sarcastic about that last item, but I've seen it happen more often than not. ------- signature starts "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 Please review the Legal Disclaimer in my bio. ------- signature ends

                  1 Reply Last reply
                  0
                  • M Marc Clifton

                    Maybe because with an SDI app you have screw around with a derived CFrameWnd, a derived CFormView, and deal with the idiotic (in my opinion) document/view architecture, either ignoring it (which isn't easy, BTW) or using it (which isn't smart, in my book), whereas a CDialog is simpler because MFC and the high school kids that wrote it don't get as much in the way of doing what you really want to do, which is get something working, instead of cursing at Microsoft's subversive plot to bog all programmers down in the quagmire of MFC while they (Microsoft) take over the world writing code in Pascal??? http://www.pseudodictionary.com/ramblerant[^] :-D 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"

                    realJSOPR Offline
                    realJSOPR Offline
                    realJSOP
                    wrote on last edited by
                    #46

                    I don't think MFC is a bad thing. If you go in with your eyes open concerning it's shortcomings, you can make much more use of it's strengths. ------- signature starts "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 Please review the Legal Disclaimer in my bio. ------- signature ends

                    M 1 Reply Last reply
                    0
                    • N Nish Nishant

                      So often you see people develop a dialog based app, then they add a menu to it, a status bar, make it resizable, make it scrollable, put a view inside it, add a document save-load option etc... Then why did they even go for a dialog based app? What they needed was an SDI app with a CFormView derived view. It's amazing how they take a dialog app and do everything to try and make it behave like an SDI app :-) Nish


                      Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

                      R Offline
                      R Offline
                      Roger Allen
                      wrote on last edited by
                      #47

                      I have been writing MFC apps for many years. I have yet to do a dialog based one! In my time I have only done 1 SDI type app as well (back in VC 1.5). These days I always stick to MFC MDI as I know it so well. I am scared of dialog based apps. :omg: Roger Allen Sonork 100.10016 Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003

                      1 Reply Last reply
                      0
                      • J Jorgen Sigvardsson

                        Mooohhhahaha! I always tease my colleague for making MFC dialog apps. -- Some of them wants to abuse you Some of the wants to be abused by you

                        D Offline
                        D Offline
                        David Wulff
                        wrote on last edited by
                        #48

                        Jörgen Sigvardsson wrote: Mooohhhahaha Have you been on the milk and cheese again? :suss:


                        David Wulff

                        "i said no to noddy like 20 times but in the end i just couldnt say no to him anymore" - Wishful Thinking

                        1 Reply Last reply
                        0
                        • N Nish Nishant

                          So often you see people develop a dialog based app, then they add a menu to it, a status bar, make it resizable, make it scrollable, put a view inside it, add a document save-load option etc... Then why did they even go for a dialog based app? What they needed was an SDI app with a CFormView derived view. It's amazing how they take a dialog app and do everything to try and make it behave like an SDI app :-) Nish


                          Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

                          A Offline
                          A Offline
                          Anand Paranjpe
                          wrote on last edited by
                          #49

                          :)Probaable reasons... 1. When people migrate from VB to VC, dialog based app is (comparatively)easier way to shift. 2. When Document-View architecture not required in project. Anand

                          1 Reply Last reply
                          0
                          • R Rob Manderson

                            How did you know that deep in my past I had some Unix experience? ;) But seriously, I'm writing applications based on someone's framework. If they provide the source code doesn't it make sense to have a look at the quality of the code? If they don't provide the source code at least let's look at all the constants and see if they missed something in the docs that maybe I need to know about ;) Rob Manderson http://www.mindprobes.net

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

                            Having the source code for someone elses library/application is great for the reasons you mention. And it is very much possible to grep around to see what the hell is going on. :-D (Very valueble indeed!) -- In the land of the blind, be king! Some day, Dominion, some say prayers, now I say mine.

                            1 Reply Last reply
                            0
                            • N Nish Nishant

                              .S.Rod. wrote: - WIN32-style app programming heritage How so? I dont think Win32/SDK coding was dialog-oriented at all! .S.Rod. wrote: fear that the CView-derived objects are such odd objects that it removes a lot of freedom This is a very likely reason. .S.Rod. wrote: MSDN doesn't make clear enough the fact that the CView class derives CWnd Oh! I never noticed that. I always took for granted that everyone would assume CWnd inheritance for CView, CDialog etc... Nish


                              Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

                              S Offline
                              S Offline
                              Shog9 0
                              wrote on last edited by
                              #51

                              Nishant S wrote: I always took for granted that everyone would assume CWnd inheritance for CView, CDialog CDocument... :rolleyes: Or anyway, that error seems to show up in questions rather a lot. ---

                              Not one of them, IMO, should be called beer. Maybe malt flavored mineral water. - Jörgen Sigvardsson on Bud, Coors and Miller

                              1 Reply Last reply
                              0
                              • M Masaaki Onishi

                                Hello, the CPians around the world. ;) Chris Maunder wrote: Poor planning. Humm, I don't believe that Chris Maunder wrote this answer.:eek: Simply saying, if we keep using only dialog base application by MFC, this wastes time so much. Try to use VB to do this unless we don't use C or C++ library. :omg: If we write SDI or MDI by MFC very well, the dialog is only used to set the property of some data, I believe. Otherwise, we never feel the beauty of MFC. (I don't read the other's message in detail, so ...?) -Masaaki Onishi (eCoolSoft)- ASP.NET Web and Windows Application Development by C# and MFC. eCoolWebPanelBar(BETA) is availabe now. http://www.ecoolsoft.com

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

                                :) My facetious answer was meant to convey the situation where a programemer may decide that they want a quick app - so they start with a dialog based app and work from there. Then they realise they have a bunch of options to offer, so they shoe-horn in a menu. Then they decide to add status info, hence a statusbar - and on it goes. Obviously not a common scenario for most programmers but I do remember doing exactly this when I was first starting out ;) cheers, Chris Maunder

                                1 Reply Last reply
                                0
                                • C Chris Maunder

                                  Poor planning. cheers, Chris Maunder

                                  B Offline
                                  B Offline
                                  BestSnowman
                                  wrote on last edited by
                                  #53

                                  Chris Maunder wrote: Poor planning. I thought it was no planning that caused it :) -BestSnowman

                                  1 Reply Last reply
                                  0
                                  • C Chris Richardson

                                    Just FYI, you can add this code to the CFormView derived class's OnInitialUpdate function to remove the "recessed" border on the SDI app:

                                    ModifyStyleEx( WS_EX_CLIENTEDGE, 0, SWP_DRAWFRAME );

                                    Chris Richardson You can stash and you can seize In dreams begin, responsibilities
                                    U2 - Acrobat[^]
                                    Stop being PC and accounting for everyone and his momma's timeframe. Just enjoy your :beer: - Rohit Sinha in the content-challenged thread

                                    R Offline
                                    R Offline
                                    Reno Tiko
                                    wrote on last edited by
                                    #54

                                    Ah, I didn't know that! I learn something new everyday from this site! Thanxs. :-D

                                    1 Reply Last reply
                                    0
                                    • realJSOPR realJSOP

                                      I don't think MFC is a bad thing. If you go in with your eyes open concerning it's shortcomings, you can make much more use of it's strengths. ------- signature starts "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 Please review the Legal Disclaimer in my bio. ------- signature ends

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

                                      John Simmons / outlaw programmer wrote: If you go in with your eyes open concerning it's shortcomings, Aye, there's the rub. Given Microsoft's EULA on .NET "though shalt not benchmark .NET", going in with open eyes is pretty hard to do nowadays. Microsoft's slogan should be "where you buy into our new technologies with eyes wide shut". 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"

                                      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