Also use the vector data member in the Struct, but in the partial function, the compilation error has occurred. This error has been plaguing me for more than two hours!
Perhaps it is always too much to believe in your own C foundation. I took a few hours when I debug a compilation error today.
This problem is
Define a struct data in the class
PUBLIC:
Struct NodeButton
{
Vector
Vector
Vector
Vector
// connstruct
}
Then use this data member in each function
It is well used in other functions, but it is used in the following forms in the following form.
Compilation error such as "Error C2228: Left of '.Handlenum' Must Have Class / Struct / Union Type"
Function Bool CdrawRect :: FindattachedObj (Int & Nhandle, Cpoint Point)
{
................................................ .
For (int J = 1; j <= (m_button.handlenum [i]); J )
{
................................................ .
}
// no attach handle!
................................................ .
}
Function cpoint cdrawRect :: getHandle (int nhandle)
{
............................................
INT index = m_currentid-id_button_first;
CRECT M_POSITION (m_button.m_rect [index]);
................................................ .
}
The two error types are the same, give me the feeling is
First, this function seems to see the member,
Second, the usage is not a bit problem (but why is it in other functions?)
I only have a try, but it has always been difficult to find a real reason. Later (after dinner), I suddenly thought that I didn't change the data into static, I tried it is actually successful! At this time, I suddenly knew why it was wrong. However, the two functions of the error were static, and the Static function could not access non-Static data members, because the static function only recognized the type, but the data member always To bundle with a direct or indirect and an object, the Static function can only access Static data members!
This is completely C grammar, but because of the major time costs have been overlooked before!
Hug hate! Hug hate!
I think it is also a low-level mistake last time, and I also spend me more time (greater than 5 hours !!) What is the reason? That is, when I contain a certain file, a repeated definition has occurred, but the solution to the solution is very simple, that is, in the header file plus
#ifndefine ***
#define *****
#ENDIF