Do you need to know the basics of C++ ie. cout etc. in order to program windows applicatipns?
Do you need to know the basics of C++ ie. cout etc. in order to program windows applicatipns?
You need to know either C or C++ and be comfortable with the features of the language otherwise you will find learning windows programming very frustrating and most likely not get all of it.
i don't think most standard compilers support programmers with more than 4 red boxes - Misplaced
It is my sacred duity to stand in the path of the flood of ignorance and blatant stupidity... - quzah
Such pointless tricks ceased to be interesting or useful when we came down from the trees and started using higher level languages. - Salem
I've learned the basics of C and the windows API, but I'd like to manipulate controls through ctl.Width, ctl.Height, etc... Since C++ is so legendary object oriented, would it be possible to "wrap up" the APIs I use into classes, and then make the class call the appropriate API to actually enforce the values (when a member such as .WIDTH has been changed)?
It's kind of possible. You can't "monitor" variables, but you can use getter and setter methods instead.
MFC is one such library, wxWindows, GTKmm, ...
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
So, the MFC (or compareable lib) adds code to compare members to theri previous values to see a change? Is there no way to make the compiler translate the instruction button.Height = xx to the appropriate API, so you don't need a bunch of IFs? Such a compiler could be visual basic ofcourse, but it's nutoriously slow and since I want to learn to make my own controls and classes, I thought I should go for the 'truly object oriented' C++
No, MFC doesn't do that. MFC hides its variables and provides setter and getter functions. That's the only proper way to go about it in C++.
You might want to look at C#, though.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
Could you elaborate a little?MFC hides its variables and provides setter and getter functions
You don't do
win.Height = 200;
in MFC. You do
win.MoveWindow(x, y, width, height);
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
I see. You don't happend to know if there's a compiler other than VB that works the way I want? What about Ruby?
I'm thinking you could associate Getter and Setter functions with the members of a class, and if a series of instructions involving the same API appear without following code that depends on it already beeing enforced, the compiler could collect them into as few API calls as possible, for example passing the RECT structure one time after seeing .Width, .Height, .Left, .Top changes... For simple things like this example you may wonder what's wrong with using either MFC-functions or the API calls directly, but I just think it would be more object oriented from a human point of view if things could work the way I described.
You see why I dream of making my own compiler?
However, I'm not aware of any compiler that can "collect" calls. That would be something extremely difficult to do, given the nature of polymorphism.Originally Posted by Me
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
They say "you can't always get what you want" (and yes, I'm also a Rolling Stones fan), but you have to agree I have a nice vision? Just tell me I'm not the only one, and if you know, point me to some resources...
I'm sure you're not the only one who dreams of things that are practically impossible to do.
What kind of resources? There's a C# board here.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
Either about existing compilers somewhat like I described, or about making compilers...What kind of resources?
Don't have anything about either, sorry. Compilers that support properties are, for example the C# compiler.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
Anyone knows if MFC or C#-style properties can be used in development for handheld (microsoft) devices?