Why do MFC programmers love dialog based apps so much?
-
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]
From what I have seen, reasons are : - WIN32-style app programming heritage - fear that the CView-derived objects are such odd objects that it removes a lot of freedom, likely to prevent you from doing what you are expected. MSDN doesn't make clear enough the fact that the CView class derives CWnd.
-
Lots of Nish, lots of us. :)
Regards,Rohit Sinha
...celebrating Indian spirit and Cricket. 8MB video, really cool!
Rohit Sinha wrote: Lots of Nish, lots of us. :confused: Nish
Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]
-
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"Gee Marc, tell us what you really think ;) Rob Manderson http://www.mindprobes.net
-
It's a combination of poor planning, trying to be quick and ignorance. I've used dialog based apps for a few appropriate applications, but mostly I use SDI. (Stripping out Document/View is a piece-of-cake, but pointless. If you don't want it, ignore it.) Nishant S wrote: It's amazing how they take a dialog app and do everything to try and make it behave like an SDI app That's what drives me nuts, especially when they wonder why such-and-such a feature "doesn't work right" and bug me. Or they post a tricky question on a board and don't explain that they are doing a dialog based app so none of your suggestions will work. I've also wondered if some colleges (among the few that teach MFC) are too lazy to teach anything complex about MFC so cop-out and just use dialog based apps.
Joe Woodbury wrote: It's a combination of poor planning, trying to be quick and ignorance. Exactly my thoughts on this. Though I'd put "ignorance" before "poor planning" Joe Woodbury wrote: I've also wondered if some colleges (among the few that teach MFC) are too lazy to teach anything complex about MFC so cop-out and just use dialog based apps. Not just colleges. I guess most of the MFC books primarily focus on dialog based apps. And for people who have done VB before, dialog based apps are easier to digest than SDI/MDI Nish
Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]
-
Gee Marc, tell us what you really think ;) Rob Manderson http://www.mindprobes.net
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]
-
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
Colin Davies wrote: Pascal ?? I hope you are not serious ? Pascal sucks! I always disliked it's syntax! Nish
Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]
-
From what I have seen, reasons are : - WIN32-style app programming heritage - fear that the CView-derived objects are such odd objects that it removes a lot of freedom, likely to prevent you from doing what you are expected. MSDN doesn't make clear enough the fact that the CView class derives CWnd.
.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.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]
I'm sometimes surprised when people don't check the derivations. I once watched a colleague spend an afternoon trying to implement serialisation for a class derived from CString (god knows why) and driving himself nuts trying to work out why the compiler kept spitting out 'unfriendly' error messages. Eventually I took pity and told him that CString ain't derived from COBject, therefore the whole serialisation framework is missing key pieces. Thing is, the source code is there, the headers are certainly there, why not take a look sometimes? Rob Manderson http://www.mindprobes.net
-
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]
My own rule of thumb is, if I need a menu I'll use SDI - if I don't then I'll probably use a dialog. I seem to remember being burned way back when (sometime in 1991) by trying to attach a menu to a dialog and having all sorts of painting problems. Sometimes when I'm feeling especially virtuous I'll use doc/view but the way it's implemented means you sometimes have to give both the document and the view special knowledge about each other - and if I have to do that then why bother with that framework? Rob Manderson http://www.mindprobes.net
-
Rohit Sinha wrote: Lots of Nish, lots of us. :confused: Nish
Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]
Er, sorry, I meant to say, "Lots of us Nish, lots of us." :) Typo. :-O
Regards,Rohit Sinha
...celebrating Indian spirit and Cricket. 8MB video, really cool!
-
Er, sorry, I meant to say, "Lots of us Nish, lots of us." :) Typo. :-O
Regards,Rohit Sinha
...celebrating Indian spirit and Cricket. 8MB video, really cool!
Rohit Sinha wrote: Er, sorry, I meant to say, "Lots of us Nish, lots of us." It's okay :-) I just thought it was one of your Rohit-special jokes and thought hard for 2 minutes trying to figure it out :-) Nish
Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]
-
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
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)
-
:-( So you are on the Dialog-app-for-all-purposes lovers side eh, Rog? Nish
Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]
Nishant S wrote: Dialog-app-for-all-purposes lovers side I didn't know there was such a side. I'm on the side that let's me get a job done without causing more work than the job is worth. Dialogs get the job done without wasting 90% of my time on trivial details. If I ever find something that I need to code that can't be done with a dialog, I'll consider SDI, but it will have to be something far more complex than anything I've ever needed before to make me waste my time again trying to make it work. "Please don't put cigarette butts in the urinal. It makes them soggy and hard to light" - Sign in a Bullhead City, AZ Restroom
-
Poor planning. cheers, Chris Maunder
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
-
Kant wrote: Are we smelling new article Nish? Maybe after June :-) Though I dunno how many people are still interested enough in MFC! :~ Nish
Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]
Not everyone is .NETing, Nish. Pavel Sonork 100.15206
-
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]
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
-
I'm sometimes surprised when people don't check the derivations. I once watched a colleague spend an afternoon trying to implement serialisation for a class derived from CString (god knows why) and driving himself nuts trying to work out why the compiler kept spitting out 'unfriendly' error messages. Eventually I took pity and told him that CString ain't derived from COBject, therefore the whole serialisation framework is missing key pieces. Thing is, the source code is there, the headers are certainly there, why not take a look sometimes? Rob Manderson http://www.mindprobes.net
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
-
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"What idiotic in document/view architecture? Please enlighten.
-
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
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
-
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
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