Hello and thank you! I'm sorry for my title if it is a bit confusing. What I'm trying to ask is very quite literally how to code in C++. Let me explain. I read a book to learn C++ and I never came across a few things that I did while reading some example code for something. And I found myself a little baffled. So I request aid.
First, here is the structure for something called Overlapped
1 2 3 4 5 6 7
|
typedef struct _OVERLAPPED {
DWORD Internal;
DWORD InternalHigh;
DWORD Offset;
DWORD OffsetHigh;
HANDLE hEvent;
} OVERLAPPED, *LPOVERLAPPED;
| |
So firstly, it is saying typedef but I don't see the type it is defining. I.e.
typedef unsigned int UINT;
Second, what the heck are OVERLAPPED, *LPOVERLAPPED.
http://www.cplusplus.com/doc/tutorial/structures/
According to the link above, they are objects that are created right from the get go. But that doesn't seem right.
Second,
1 2 3 4 5 6
|
class simpleRunnable: public Runnable {
public:
...
virtual void* run() {
...
};
| |
What does the colon after simpleRunnable mean?
It is similar to the following code but I'm not sure if the colon is being used with the same context. So if it is different, I appreciate being told what the colon after the function name below means:
1 2 3
|
SimpleCat::SimpleCat(int age, int weight):
itsAge(age), itsWeight(weight) //Please note, itsAge and itsWeight are variables in the class declaration
{}
| |
Next, in the following line,
|
std::auto_ptr<Runnable> r(new simpleRunnable(1));
| |
What do the angle brackets mean?
And finally, I often see this (that is to say, I'm refering to the word, WINAPI:
1 2 3 4
|
unsigned WINAPI Thread::startThread(LPVOID pVoid) {
Thread* aThread = static_cast<Thread*>(pVoid);
....
}
| |
The other variation I see is CALLBACK. I actually found what CALLBACK means which, if I have it correct, is only used when there are multiple threads and it is simply used to "call back" the function that called it when a task will take some time to complete or its processing time runs out.
But when I looked up WINAPI, I just got definitions and stuff.