Helpful Information
 
 
Category: C Programming
Gui programs for windows - how 2 do?

Hello,

Ok, what I want to do is program for windows. I can already do this with MFC, but it is not what I'm looking for.

Unless my knowledge of MFC is really really limited (although, I know I am far from an expert), I don't think I can do this with it, and besides, I don't really like the MFC.

I want to be able to program GUIs like the microsoft programs have, like Outlook (XP), and Visual Studio. I want to be able to program the sleek buttons, and dockable windows, menus / task bars. I want to be able to make IDE's like visual studio, etc...

I just love the look of the new office XP, but I can't figure out how they did it (I mean, what tools they used). I want to be able to make programs that look like that.

I know this is ambitious, etc... but I am highly motivated. I want to be able to do all this, but I do not know where to start.

Can I do all this with the win32 API? Is there a better way? Where can I learn? What books are good? sites? documentation?

Please, Please orrient me somewhere. I get so frustrated trying to find out how to learn all this, but can't find a way to learn. Where do I start?

I know C++ (and other languages, but want to use c++), and I have experience with the MFC classes, and wxWindows.

Thanks for your time,
Carl lerche

A couple of links you might want to check out:

http://www.codeproject.com/


Depending on your needs, you can purchase source code to accomplish some of the things you want to do. This of course does not appeal to everyone but for some people, the time saved is worth the money:

http://www.roguewave.com/products/stingray/screenshots.cfm
http://www.dundas.com/products/mfc/toolbox/index.asp

As dcaillouet said, visit The Code Project. They have a lot of the source code that you're looking for.


Can I do all this with the win32 API?

Yes, but you'll be in for a world of hurt. If you're a sadist, then by all means go with the Win32 API, but MFC, WTL, or some other wrapper library will make your life a lot easier.

You might also consider buying a few books:

Programming Windows with MFC 2nd Ed. (Jeff Prosise)
MFC Internals (Shepherd Wingo)
Professional MFC (Mike Blaszczak)

Good luck!

Hello,

Thanks for your replies, I am checking out codeproject now. Also, what exactly is WTL and where can I find it?

Also, I think I didn't express myself perfectly. I am aware that I can obtain source code for everything that I want to do, but that isn't exactly what I want. I hate not knowing how things work, I like getting to the guts of everything (that is why I am learning assembly and starting to look into drivers and hardware, and stuff like that).

What I really want to learn is how everything works, from the lowest level possible. Is the win32 API the lowest level available for devellopers on the windows platform? I want to be able to, if needed, make all the source code I need, or modify existing code.

What I want to be able to do is be able to understand how the MFC works. Have a strong understanding of everything, and not just create an SDI application, and not really understand what's going on (for example).

So, basically, what is the lowest level available? And then how should I work my learning up from there, so that eventually, I could write my own sets of classes, etc... (yeah, eventually, I would like to participate on the wxWindows project).

But, I'll look into some of this stuff already,
Thanks,
Carl

I might get flamed for this, but have you tried C++ Builder from Borland. You can learn a lot about class design from the source code for their components.

P.S.:

I don't really want to pay $500 for all that source code ;) After all, I am a college student (can anybody say poor).

I have a lot of ideas for software that I want to write, but I just can't write now. I mean, I could, but not exactly the way I want. And I really stress perfection with my work, and I want to be able to make it perfect.

Carl

Scorpions4ever:

No I haven't, I'm still quite new to the world of programing and C++. I am limited to Visual C++ (that's what I have, and I don't think I could buy anything else).

Please guide me, I am open to anything in order to reach my final goal, which is ultimate knowledge (yeah, I hate not knowing everything).

Well, if you really want to learn from the ground up, then you're on the right track:

* Learn 80x86 Assembly
* Learn C (which you probably have)
* Study the hell out of the Win32 API (buy Charles Petzold's book. It's an invaluable reference. You can also learn a lot from the MSDN library).
* Learn C++. There are many, many good books out there, at least one of which I know is available for free online.
* Learn MFC

This will give you a very solid foundation in Windows programming.

Actually the reason why I suggested C++ Builder is because building GUIs are very easy when you're using it. The components can be dragged and dropped onto your form and programming GUIs with sleek buttons and toolbars is a breeze. The standard package comes with a whole lot of GUI components and there are several third party freeware components available for it on the web. It's a very handy RAD tool if you want to get a good GUI up real quickly.

The downside of this is that the size of a program with one form in it is rather large, compared to something written in MFC or straight C. This is due to Borland's rather larger Visual Component Library (VCL) and classes. However, as you add more forms/controls to the project, the size does not increase by very much more because of code reuse.

For one project that we wrote a while back, the main code was done with Borland C++ Builder, because it involved a large number of forms and menus. However, we wrote the web-installer program in Visual C++, as the installer had to be small (for quick download across the web) and had practically no GUI components in it. The installer would run and download the much bigger program and libraries in the background. The web installer was initially written in MFC and then I wrote one version in C with the framework swiped straight out of Charles Petzold's book. As jonsagara mentioned, it is an invaluable reference.

AFAIK, WTL is largely undocumented. The Code Project has a little section on how to obtain it, though:

http://www.codeproject.com/wtl/wtlintro1.asp

Hello,

Can anyone suggest any recent (or good books for learning) regarding the win32 API? Well, one that's good for a beginner, and then a good comprehensive reference book? Thanks...

Carl

There's really only one: Charles Petzold's "Programming Windows, The Definitive Guide to the Win32 API." This assumes that you have a solid grasp on the C programming language.

If you know some C, then buy "The C Programming Language" by Kernigan and Ritchie. GREAT book.

If you don't know any C, then K&R may be a bit dense for a beginner, so you should get a beginner's book. Any beginning C++ book will do, such as "Thinking in C++ 2nd Ed." by Bruce Eckel. After learning the basics of the language, K&R will be much easier to digest.

Well, I know C++, so I guess I know C.

and, I know some algorythm stuff, like sorting, searching, etc...
I feel like I have a pretty good grasp of C++. But, I really like the OOP aspect, so I'm not a big fan of C. Sure, I know most of the time it's useless, but, to me, it's a lot more clear in the code.

Carl

Sorry if I'm being harrasing, I'm just trying to get everything straight in my mind.

When I'm done with "Programing windows" will I be able to make my own controls? Like dockable windows, etc...?

Thanks,
Carl

Well, yes, but as I said earlier, that will cause you great pain. Once you know the Win32 API, you should really learn and use MFC to make GUI components (the best book for this IMHO is Jeff Prosise's "Programming Windows with MFC 2nd Ed."). Your life will be much, much simpler. The Win32 API uses C, whereas MFC is an object oriented wrapper of the API.

Why do you object to using MFC? I think you said you already have VC++, so you have everything you need.

I think you said earlier that OOP is useless most of the time. This is absolutely not true. MFC is written with C++ and uses OOP extensively. MFC stands for Microsoft Foundation Classes. Here at my workplace, our whole project is based on various C++ classes. Everywhere I look, I see OOP, so it's definitely a good thing to know. Languages like Java and C# are also strictly OOP (so I've been told - I've never actually taken the time to learn them thoroughly).

Hello,

Well, when I said that oop is useless most of the time, I meant for what I was doing...

And when I said useless, I meant that it was possible to do it without classes. Not that it was better to do it without classes.

My bad, I messed up with my diction.

Oh, and the reason I don't like MFC, is because I don't find it very clear. I use wxWindows, and I find that a lot clearer. Maybe it's because of the way the MFC books are written. I am by far an expert with the MFC, and that may be why I don't find them clear. But, it is the fact that everything is not written by hand (in the books), that you have to go to the class something or another to declare a new event, etc...

I know that this is not required to do, but I have yet to find a book that explains how to do everything by hand... and I like that better, because I feel like I have a better understanding with what's going on.

Basically, MFC confuses the heck out of me, where as wxWindows seams very straight forward...

Please forgive my ignorance,

Thanks,
Carl

Ahhh...

In that case, I recommend Ivor Horton's "Beginning Visual C++ 6." I used a previous version of this book when I was first starting out, and I really liked it. It's perfect for beginners to MFC. The first couple of chapters teach C++, which you can probably skip, but may want to glance over. After that, Horton dives right into VC6 and teaches you everything you need to know in order to create an MFC application. He explains message maps, controls, dialogs, etc...

I don' t know of any online tutorials that are as "friendly" as this book.

Thanks,

the 2 books are on there way...

I wish I didn't have to spend so much time in my stupid classes at school so I could spend more time on this.

Engineering Problem solving... god what a waste of time. wow, I didn't know how to put points on a graph and perform aproximations, so I have to spend 4 hours a week in class to learn :mad:

Such frustration....

Carl

I have a good question: where can I find this thing you call time? And are there any books on programming it? :D

Actually, what a great thread! I program perl and learned only the most basic basics about C. There's one book in perl that is obviously the "big dog" and I was going to try and find out what the "big" books for C and C++ are. Now I know! Excellent!

I started learning Windows programming last week using Charles Petzold's book. I have to complete a small project in VC++ within 18 days. I'm through with half of it, but the only hurdle, is creating dockable windows without using MFC. Is it really possible ? if so can u guide me ?










privacy (GDPR)