Results 1 to 10 of 10

Thread: Mfc

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 1999
    Location
    Freeport
    Posts
    204

    Mfc

    I just completed my ADV C++ class in college and did real good. My problem is that it did not cover MFC. I have made one with the wizard but do not understand what I did. I know how to use control in VB and I know your to use handle to control the control in C++. I not sure how to do this or what it is about. If any one know a tutorial are some that will help me under stand that would be great. I want to build a MFC program with a tree. So the user can use the dropdown to access imformation from a data base. Example
    +Adm
    +Accounting
    +Share Sevices
    +Members
    +Member Pay
    etc.

  2. #2
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544
    I have found a few sites for you:

    http://msdn.microsoft.com/library/de..._available.htm

    http://mfcfaq.stingray.com/

    I hope they help you!
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

  3. #3
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169

    Re: Mfc

    Originally posted by ScottF
    I just completed my ADV C++ class in college and did real good. My problem is that it did not cover MFC.
    That's because it's a class on C++

    Are you familiar with Windows programming in C++ at all yet? If not I really wouldn't recommend using MFC because as soon as it gets slightly complex you'll be totally lost (I was, so I gave up MFC and learnt API instead).

    If you want an object-oriented interface onto it, then WTL is probably a better idea (comes with the Platform SDK and is only for VC++6, though). That assumes more knowledge of the API though, but doesn't need huge runtimes
    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

    Thread Starter
    Addicted Member
    Join Date
    Apr 1999
    Location
    Freeport
    Posts
    204

    Yes

    Believe or not but I just finshed my ADV C++ class a college an made a A. The problem is that we did not do any of the wizards or API. Just learn the basic of programing C++ and Classes and some Inher.

  5. #5
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    That's my point though...it's a C++ course, not a course on using VC++ (thers's a difference )

    If you want to do Windows programming, learn using the API first, before trying MFC. MFC hides a lot of the underlying system from you, which is not good when you're learning.
    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

  6. #6
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Just to start you off with the API stuff, you can create controls using the CreateWindow() (or the newer CreateWindowEx()) function, with a predefined windowclass name that identifies what kind of control you're after.

    If you don't know too much about Windows programming, it's a good idea to start with that rather than worry about MFC, for the moment at least.
    Harry.

    "From one thing, know ten thousand things."

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Apr 1999
    Location
    Freeport
    Posts
    204
    So when I go to File -New do I use a standard File C++ Source file or do I go to Projects

  8. #8
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Projects.

    If you feel comfortable with console apps then you can try Windows apps. Start a new Win32 Application project and go from there, adding whatever source files you want.

    The main thing you need to understand well (IMO) is pointers. There isn't a whole lot of object-orientation involved with the Windows API, it's mostly just straight C stuff.

    Windows programming is quite different, in case you don't already know. Everything starts at WinMain() and you have to deal with Windows messages. It can be a bit confusing to start with but it's not that bad. If I were you I'd get a book on it or something. If you're more of a net tutorial person then go look through some posts by people wanting to start Windows programming in C/C++. Vlatko must have posted his list of tutorial sites like 3 zillion times by now
    Harry.

    "From one thing, know ten thousand things."

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Apr 1999
    Location
    Freeport
    Posts
    204

    Thanks

    I want to thank you for your help. I have one other question I been reading on API calls and know that every windows hass a handle h. If i place a textbox on a window how do I give it a handle. Code please

  10. #10
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    CreateWindow & CreateWindowEx return a handle (HWND) to the created window, or NULL if it failed...code has been posted many times, but here's something that shows how to make controls:

    http://www.parksie.net/Raw.zip
    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