Results 1 to 5 of 5

Thread: Quick Q about Pointers and a prog to try?

  1. #1

    Thread Starter
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527

    Quick Q about Pointers and a prog to try?

    1stly:

    PHP Code:
                    CEditpEdit1 = (CEdit*)GetDlgItem(IDC_EDIT_FIRST);
        
    pEdit1->LimitText(20); 
    why do I have to declare the edit box as a pointer before I can manipulate it?

    why can't i just do:

    GetDlgItem(IDC_EDIT_FIRST)->LimitText(20);

    also

    I am very new to Visual C++ and was wondering if anyone could give me some easy program ideas to try??

  2. #2

    Thread Starter
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    Thanks

    What do you use then?

  3. #3
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    I use the API I made the mistake of half-learning C, then trying to use MFC. I got part-way, then found it incredibly hard to work out all the gibberish with MESSAGE_MAP and all that, before I decided to scrap it, learn C++ properly. After that, I made some good stuff, but I didn't understand half the code it produced, so I looked at MSDN to see if there was any other way of making Windows programs...to find the Platform SDK waiting for me

    And the rest, as they say, is history
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  4. #4
    parksie, i dont understand you when you say that MFC is evil...i think its better to use "precreated" classes with wide support than write classes self - i think if you want to write large projz, you will have to write "some" classes...

  5. #5
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    The thing with MFC is, it's an "all-or-nothing" affair a lot of the time. If you bring one part in, it grabs most of the rest as well. Also, a lot of MFC has equivalents in the STL, which is smaller, faster, and *standard*.

    Yes, I agree it's often better to have something that's widely accepted, but in most cases...why? You can write a small set of classes in an evening to simplify making a window, and it hardly adds any extra code. Also, MFC hides most of the underlying execution from you, which I don't like.

    When I say MFC is evil, that's my opinion (which I'm entitled to ).
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width