This topic is now archived and is closed to further replies.

Guest Anonymous Poster

RECT Beginner Problem

This topic is 6691 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

My guess is that you arn't declaring the structure of RECT. It is part of the MFC headers in Visual C++, so if your project isn't including MFC, and you arn't explictly including any of the headers, then you will have to define it yourself. This isn't hard. The structure can be found in the help files:

typedef struct tagRECT {
LONG left;
LONG top;
LONG right;
LONG bottom;

Share this post

Link to post
Share on other sites
RECT is defined in windef.h which is automatically included if you include windows.h. So if it's a Windows app, regardless of the flavor, RECT is defined. Since he said he included all the appropriate headers, I'm guessing that windows.h was one of them.

If it's not a Windows program,, of course RECT would have to be defined.

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
Here's what I've wrote :

RECT rect1 , rect2 , rect3 , rect4 , rect5 ;

line (21) rect1.left=4615;;

And here what the Compiler says :
check.cpp(21) : error C2501: 'rect1' : Missing Declaration
check.cpp(21) : error C2371: 'rect1' : Newdefinition ; different Basis Types
check.cpp(21) : error C2239: Unexpected Token '.' after Declaration of 'rect1'
check.cpp(21) : error C2059: Syntax Error : '.'

I've included all important header files!

Share this post

Link to post
Share on other sites