PDA

Click to See Complete Forum and Search --> : Mfc


ScottF
May 4th, 2001, 07:00 PM
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.

CyberCarsten
May 5th, 2001, 03:24 AM
I have found a few sites for you:

http://msdn.microsoft.com/library/devprods/vs6/visualc/vccore/_core_mfc_tutorials_available.htm

http://mfcfaq.stingray.com/

I hope they help you! ;)

parksie
May 5th, 2001, 06:45 AM
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 :)

ScottF
May 5th, 2001, 09:48 PM
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.

parksie
May 6th, 2001, 06:18 PM
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.

HarryW
May 6th, 2001, 06:52 PM
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.

ScottF
May 6th, 2001, 08:24 PM
So when I go to File -New do I use a standard File C++ Source file or do I go to Projects

HarryW
May 6th, 2001, 09:30 PM
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 :rolleyes:

ScottF
May 7th, 2001, 01:35 AM
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

parksie
May 7th, 2001, 06:02 AM
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