A question about form...

This is a discussion on A question about form... within the C++ Programming forums, part of the General Programming Boards category; Please excuse me if this is kind of vague... I'm looking for something a bit less specific than programming code ...

  1. #1
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547

    A question about form...

    Please excuse me if this is kind of vague... I'm looking for something a bit less specific than programming code this time...

    If I had a one-man project, on the larger size... Lets say something like a Windows based music collection manager... hefty but not beyond a single person, in a reasonable amount of time...

    How would I organize this in C++?

    For example... should the usual WinProc and message dispatcher be in a Class or should they be done C style?

    Should Dialogs be in Classes or C style?

    Class declarations in headers, definitions in cpp files? (This seems obvious)

    Roughly what portion of the code might I expect to be procedural and what part in Classes?

    No specifics here... just looking for a better "feel" for the environment...

    Thanks in advance...

  2. #2
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,673
    If you're going to use the WinAPI for this program then yeah, you could be stuck writing a lot of classes yourself if you want an object-oriented design for that. You don't have to though. You could use a more object-oriented GUI API, or you could take a more multi-paradigm approach; that is, use C++ to write procedural GUI code.

    Class declarations in headers, definitions in cpp files? (This seems obvious)
    Yes, unless they are templates. If they are templates, the simplest thing is to put everything in an h file.

  3. #3
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by whiteflags View Post
    If you're going to use the WinAPI for this program then yeah, you could be stuck writing a lot of classes yourself if you want an object-oriented design for that. You don't have to though. You could use a more object-oriented GUI API, or you could take a more multi-paradigm approach; that is, use C++ to write procedural GUI code.
    That's sort of the way I'm leaning right now. I'm thinking procedural code for the GUI and windows message handling, perhaps a few utility routines... the stuff you basically plow through once... Then having all the data handling etc. in Classes. Sort of like I did in my "self-test" program I posted in the other thread; but, of course, far more organized.

    I picture a WinProc who's switch statement is filled with calls to class members...

    99% of what I do has been at the WinApi level, if that's any help. I'm far more inclined to get right down and dirty with the OS than to spend my time looking for classes or libraries to do my work for me... It always feels better when the program finally gets up and does it's thing.

  4. #4
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,596
    Why not use MFC? It has been recently updated and for dialog applications is quite simple to use.

  5. #5
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by Bubba View Post
    Why not use MFC? It has been recently updated and for dialog applications is quite simple to use.
    I'll take a look... I don't know if it's changed since my first experience with it but I seem to recall having to distribute multiple DLLs with my code... Which I'd really prefer not to do. I like writing standalone programs whenever possible.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reopening a form ?
    By Aga^^ in forum C# Programming
    Replies: 1
    Last Post: 02-11-2009, 08:28 AM
  2. Calling datas from another form?
    By Aga^^ in forum C# Programming
    Replies: 2
    Last Post: 02-06-2009, 01:17 AM
  3. question: i/o data form .txt or .xls files ??
    By camelman in forum C++ Programming
    Replies: 21
    Last Post: 11-17-2007, 02:48 PM
  4. Design layer question
    By mdoland in forum C# Programming
    Replies: 0
    Last Post: 10-19-2007, 04:22 AM
  5. PHP simple question : undefined index
    By FloatingPoint in forum Tech Board
    Replies: 5
    Last Post: 07-16-2003, 07:01 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21