• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Object Oriented C++

Brian23

Banned
I've been learning C++ for about 5 months now. Until recently, I only programed console applications. I want to learn to do the visual part now, but I can't find a place that explains it well. I want to actually implement visual objects like buttons with code. All of the tutorials I've found want you to use the MS Foundation Classes, but I want more control over the program than MFC gives you. How do I put buttons and other objects into a window WITHOUT using MFC?
 
Why in the hell would you want to avoid libraries made to make your life easire (well MFC is so convluted easier is subjective =))?
 
Why in the hell would you want to avoid libraries made to make your life easire

Doing stuff by yourself is the best way to learn...

only programed console applications

Sorry, still at that level...
 
One of my better CS professors had a saying about programming: "Don't reinvent the wheel when you don't have to.". This is very good advice. Do something your own way once so you know how it works, then just use the provided stuff. We didn't get where we are nowdays by everybody sitting down and writing every program from scratch did we? Afterall reuseability is one of the prime concerns when writing code.
 
Petzold's Programming Windows is C not OO C++ but it gives you the actual Win32 API calls to use. You can then play with writing C++ wrapper classes. You'll end up with classes a lot like MFC's control classes (CEdit for edit control etc.) but it will be a good learning experience.
 
Doing stuff by yourself is the best way to learn...

Yea, but who needs to know the Win32 GUI APIs that intimately?
 
you should have enough control with ur program using mfc. anything you do with the base win32 api, you can do with mfc, its pretty much an object-oriented method of dealing with the nasty c-oriented win32 api. besides, you can always call base functions outside of the mfc namespace at any time with the :: operator.
 
Follow DaveSimmons advice.

I learned Windows programming for NT when it was still in Beta by using the API and then graduated to Petzolds. I still keep his Programming 95 and another book around for reference.

Have the info for API reference is also great if you need to program for Windows using a non-Windows IDE system or language.

ONce you go through both of the referenced books, you will have a much stonger understanding on how the internals of Windows operates and then can proceed along your chosen direction with your head held high and not be just a programmer but consider yourself a developer.😀
 
Yea, but who needs to know the Win32 GUI APIs that intimately?

Well, I wouldn't do this but maybe Brian23 wants to...
 
I learned Windows programming for NT when it was still in Beta by using the API and then graduated to Petzolds. I still keep his Programming 95 and another book around for reference.

Have the info for API reference is also great if you need to program for Windows using a non-Windows IDE system or language.

ONce you go through both of the referenced books, you will have a much stonger understanding on how the internals of Windows operates and then can proceed along your chosen direction with your head held high and not be just a programmer but consider yourself a developer


10/10 for the answer 😛

 
Well, I wouldn't do this but maybe Brian23 wants to...

He obviously doesn't realize what he's getting himself into then =)
 
He obviously doesn't realize what he's getting himself into then =)


I know, but if he succeds in his "Quest" hehehe he'll be a damn good programmer (or developper... sorry bout that EagleKeeper 😛 )
 


<< Yea, but who needs to know the Win32 GUI APIs that intimately? >>



It's much, much more than simply learning the API. I can't remember all the fields for the wndclassex struct, but I remember all the concepts involved with constructing a Windows application from scratch. I learned has helped me immensely, even with learning .NET. Everything more/less derives from the same concepts.

Pick up Petzold, and read it. You don't really have to read the whole damn book, but I think you'll find it rather enjoyable really. Building an entire Windows application from scratch in C is not a quick process, but it's quite fun really.

These days we often depend too heavily on nasty class libraries that encapsulate all the details. While this is good, and the foundation of OO itself, it still pays to understand the internals when things go awry.
 
True, however I found it easier to start with MFC classes and then just try and get the rest right.
Actually, the lack of flexibility of MFC (unless you are a pointer juggler) forced me to program cleaner code.
 
Thanks guys! I just ordered that book. I've been messing with C++ a little bit while I wait for the book. It looks like Nothinman was right when he said that I didn't know what I was getting into. 🙂 It's complicated stuff, a lot more than console apps, but I'm determined to learn it.
 
It's complicated stuff, a lot more than console apps, but I'm determined to learn it.

Like I've said in other threads like this, I would choose another tool kit that is simpler and has the benefit of being crossplatfor like GTK or QT, there's no reason to force MFC upon yourself. Of you could go even easier and start using Borland C++ Builder, it's great for putting together GUI apps quickly.
 
Back
Top