Mouse Problem
I am trying to use typedef struct tagMOUSEINPUT from winuser.h for my program but I cant figure out how to use it. I cant create a variable of that type (eg. tagMOUSEINPUT Mouse. Am I missing a library or header? or am I trying to use it wrong? BTW, Like it says on MSDN, I am also including windows.h.
In order to use the struct tagMOUSEINPUT you need to create an instance like this.
MOUSEINPUT MyMouseInput;
Just remove the tag. That should work. The tag on the beginning just means that they want to give the struct a name but want to typedef it to something else. So they use tag on the beginning and then use typedef. If you looked in MSDN you'll see that the struct is actually
typedef struct tagMOUSEINPUT
{
//vars
}MOUSEINPUT,FAR *MOUSEINPUT;
By using typedef they are saying that MOUSEINPUT means struct tagMOUSEINPUT. But doesn't neccesarily mean you can use struct tagMOUSEINPUT.
From a FLOOP (Freak of Object Oriented Programming)
[edited by - RamboBones on September 25, 2002 6:35:16 PM]
MOUSEINPUT MyMouseInput;
Just remove the tag. That should work. The tag on the beginning just means that they want to give the struct a name but want to typedef it to something else. So they use tag on the beginning and then use typedef. If you looked in MSDN you'll see that the struct is actually
typedef struct tagMOUSEINPUT
{
//vars
}MOUSEINPUT,FAR *MOUSEINPUT;
By using typedef they are saying that MOUSEINPUT means struct tagMOUSEINPUT. But doesn't neccesarily mean you can use struct tagMOUSEINPUT.
From a FLOOP (Freak of Object Oriented Programming)
[edited by - RamboBones on September 25, 2002 6:35:16 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement