tolw's answer is good. I will just add a note about question 2: the
::AfxBeginThread
syntax.
In this case the code will compile with or without the
::
. The code writer just wanted to focus on the fact that this function is not part of his class but is part of the global scope as
tolw already told you.
You will find similar things about
this
syntax: a few people will write
this->someVariable...;
Instead of directly accessing the variable:
someVariable...;
Even though it would compile without
this
, the coder wants to show that
someVariable
is part of the class.
Actually, MFC naming convention prefered to prefix variable names with
m_
when they are members of a class (
m
meaning
member of course), which makes the use of
this
unnecessary.
I sometimes find people naming their
local variables
m_xxx
! Please don't do that since it brings only confusion...