|
Thread: Mfc
-
May 4th, 2001, 07:00 PM
#1
Thread Starter
Addicted Member
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.
-
May 5th, 2001, 03:24 AM
#2
Frenzied Member
-
May 5th, 2001, 06:45 AM
#3
Monday Morning Lunatic
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
-
May 5th, 2001, 09:48 PM
#4
Thread Starter
Addicted Member
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.
-
May 6th, 2001, 06:18 PM
#5
Monday Morning Lunatic
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
-
May 6th, 2001, 06:52 PM
#6
Frenzied Member
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."
-
May 6th, 2001, 08:24 PM
#7
Thread Starter
Addicted Member
So when I go to File -New do I use a standard File C++ Source file or do I go to Projects
-
May 6th, 2001, 09:30 PM
#8
Frenzied Member
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."
-
May 7th, 2001, 01:35 AM
#9
Thread Starter
Addicted Member
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
-
May 7th, 2001, 06:02 AM
#10
Monday Morning Lunatic
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|