Struct of Rects can't compile
I am trying to have a structure of RECTs to hold all the labels at the top of my screen. The declarations does nto give me any errors or anything but when I try to initialize the rectangles I get errors.
The errors I get are
Code:
c:\documents and settings\administrator\my documents\my projects\dosage\dosage.cpp(411) : warning C4832: token '.' is illegal after UDT 'WndProc::labels'
c:\documents and settings\administrator\my documents\my projects\dosage\dosage.cpp(130) : see declaration of 'WndProc::labels'
c:\documents and settings\administrator\my documents\my projects\dosage\dosage.cpp(411) : error C2275: 'WndProc::labels' : illegal use of this type as an expression
c:\documents and settings\administrator\my documents\my projects\dosage\dosage.cpp(130) : see declaration of 'WndProc::labels'
c:\documents and settings\administrator\my documents\my projects\dosage\dosage.cpp(412) : warning C4832: token '.' is illegal after UDT 'WndProc::labels'
c:\documents and settings\administrator\my documents\my projects\dosage\dosage.cpp(130) : see declaration of 'WndProc::labels'
c:\documents and settings\administrator\my documents\my projects\dosage\dosage.cpp(412) : error C2275: 'WndProc::labels' : illegal use of this type as an expression
c:\documents and settings\administrator\my documents\my projects\dosage\dosage.cpp(130) : see declaration of 'WndProc::labels'
c:\documents and settings\administrator\my documents\my projects\dosage\dosage.cpp(413) : warning C4832: token '.' is illegal after UDT 'WndProc::labels'
c:\documents and settings\administrator\my documents\my projects\dosage\dosage.cpp(130) : see declaration of 'WndProc::labels'
c:\documents and settings\administrator\my documents\my projects\dosage\dosage.cpp(413) : error C2275: 'WndProc::labels' : illegal use of this type as an expression
c:\documents and settings\administrator\my documents\my projects\dosage\dosage.cpp(130) : see declaration of 'WndProc::labels'
c:\documents and settings\administrator\my documents\my projects\dosage\dosage.cpp(414) : warning C4832: token '.' is illegal after UDT 'WndProc::labels'
c:\documents and settings\administrator\my documents\my projects\dosage\dosage.cpp(130) : see declaration of 'WndProc::labels'
c:\documents and settings\administrator\my documents\my projects\dosage\dosage.cpp(414) : error C2275: 'WndProc::labels' : illegal use of this type as an expression
c:\documents and settings\administrator\my documents\my projects\dosage\dosage.cpp(130) : see declaration of 'WndProc::labels'
c:\documents and settings\administrator\my documents\my projects\dosage\dosage.cpp(415) : warning C4832: token '.' is illegal after UDT 'WndProc::labels'
c:\documents and settings\administrator\my documents\my projects\dosage\dosage.cpp(130) : see declaration of 'WndProc::labels'
c:\documents and settings\administrator\my documents\my projects\dosage\dosage.cpp(415) : error C2275: 'WndProc::labels' : illegal use of this type as an expression
c:\documents and settings\administrator\my documents\my projects\dosage\dosage.cpp(130) : see declaration of 'WndProc::labels'
c:\documents and settings\administrator\my documents\my projects\dosage\dosage.cpp(416) : warning C4832: token '.' is illegal after UDT 'WndProc::labels'
c:\documents and settings\administrator\my documents\my projects\dosage\dosage.cpp(130) : see declaration of 'WndProc::labels'
c:\documents and settings\administrator\my documents\my projects\dosage\dosage.cpp(416) : error C2275: 'WndProc::labels' : illegal use of this type as an expression
c:\documents and settings\administrator\my documents\my projects\dosage\dosage.cpp(130) : see declaration of 'WndProc::labels'
c:\documents and settings\administrator\my documents\my projects\dosage\dosage.cpp(417) : warning C4832: token '.' is illegal after UDT 'WndProc::labels'
c:\documents and settings\administrator\my documents\my projects\dosage\dosage.cpp(130) : see declaration of 'WndProc::labels'
c:\documents and settings\administrator\my documents\my projects\dosage\dosage.cpp(417) : error C2275: 'WndProc::labels' : illegal use of this type as an expression
c:\documents and settings\administrator\my documents\my projects\dosage\dosage.cpp(130) : see declaration of 'WndProc::labels'
the declaration of the structure is:
Code:
struct labels{
RECT name;
RECT height;
RECT weight;
RECT drug1;
RECT drug2;
RECT drug3;
RECT symptoms;
};
The place where I am getting the errors is the following lines
Code:
SetRect( &labels.name, rect.left, rect.top, a, b);
SetRect( &labels.height, rect.left + a, rect.top, rect.right + (2 * a), b);
SetRect( &labels.weight, rect.left + (2 * a), rect.top, rect.right + (3 * a), b);
SetRect( &labels.drug1, rect.left + (3 * a), rect.top, rect.right + (4 * a), b);
SetRect( &labels.drug2, rect.left + (4 * a), rect.top, rect.right + (5 * a), b);
SetRect( &labels.drug3, rect.left + (5 * a), rect.top, rect.right + (6 * a), b);
SetRect( &labels.drug1, rect.left + (6 * a), rect.top, rect.right + (7 * a), b);
What am I doing wrong? Everything is correct according to my knowledge and MSDN. Can anyone help me?