|
-
July 11th, 2010, 01:15 AM
#1
TRACKMOUSEEVENT (error C2065)
Guy,
In a child window WndProc(), I would like to use TrackMouseEvent(), inside WM_MOUSEMOVE block so I can fired up message on WM_MOUSELEAVE.
To use TrackMouseEvent(), i need to declare TRACKMOUSEEVENT structure and fill up its data members. However, my MS Visual Studio 2005, keep telling me it I have error C2065: undeclared identifier.
I have include windows.h in the header file.
It is have been outdated?
Thanks
Code:
LRESULT CALLBACK SplitterPanel::WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
{
static HCURSOR hcursor1, hcursor2;
static bool isHovering;
TRACKMOUSEEVENT tm; //the error pointing to
switch(iMsg){
case WM_CREATE :
hcursor1 = ::LoadCursor(NULL, IDC_SIZEWE);
hcursor2 = ::LoadCursor(NULL, IDC_ARROW);
break;
case WM_MOUSEMOVE:
break;
case WM_CLOSE :
DestroyWindow(hwnd);
break;
case WM_DESTROY :
PostQuitMessage(0);
break;
}
return ::DefWindowProc(hwnd, iMsg, wParam, lParam);
}
-
July 11th, 2010, 04:25 AM
#2
Re: TRACKMOUSEEVENT (error C2065)
1. Check out your project settings correspond the requirements for TRACKMOUSEEVENT Structure
2. Have a look at http://www.google.com/search?sourcei...red+identifier
Victor Nijegorodov
-
July 13th, 2010, 09:44 PM
#3
Re: TRACKMOUSEEVENT (error C2065)
ohhhhhh...
I need to have
Code:
#define _WIN32_WINNT 0x0400"
before the "#include <windows.h>".
Why this requirement is not documented in the MSDN
-
July 14th, 2010, 01:08 AM
#4
Re: TRACKMOUSEEVENT (error C2065)
It was documented in old previous versions of MSDN (there was a link in Requirements section)
Victor Nijegorodov
-
July 14th, 2010, 06:47 AM
#5
Re: TRACKMOUSEEVENT (error C2065)
Well, it is documented, but I agree it could be better. If you look at the page for TRACKMOUSEEVENT, at the bottom you'll see:
 Originally Posted by MSDN
Minimum supported client: Windows 2000 Professional
If you then take a look at Using the Windows Headers, you can find out what values you should use.
It's strange though that it works for you with 0x0400, because according to the docs it should be 0x0500
-
July 14th, 2010, 06:55 AM
#6
Re: TRACKMOUSEEVENT (error C2065)
 Originally Posted by Marc G
If you then take a look at Using the Windows Headers, you can find out what values you should use.
It's strange though that it works for you with 0x0400, because according to the docs it should be 0x0500
It is because MSFT cancelled any support of all OS versions prior to 2000 (such as Win98, NT4,...)
and now it appears to just "forget" these versions ever exist! 
In my MSDN from Oct. 2000 the requirements are:
Requirements
Windows NT/2000: Requires Windows NT 4.0 or later.
Windows 95/98: Requires Windows 98.
Header: Declared in Winuser.h; include Windows.h.
which means:
_WIN32_WINDOWS=0x0410 and WINVER=0x0400
Victor Nijegorodov
-
July 14th, 2010, 07:10 AM
#7
Re: TRACKMOUSEEVENT (error C2065)
Mmmm, that's interesting, didn't know that.
-
July 14th, 2010, 07:14 AM
#8
Re: TRACKMOUSEEVENT (error C2065)
No problem!
I know it only because I'm still using VC++6.0
Victor Nijegorodov
-
July 14th, 2010, 07:24 AM
#9
Re: TRACKMOUSEEVENT (error C2065)
Ah, I was wondering why you would be keeping a decade old MSDN lying around
-
July 14th, 2010, 07:26 AM
#10
-
July 15th, 2010, 02:39 AM
#11
Re: TRACKMOUSEEVENT (error C2065)
Thanks Guys.
I don't know that I have to define the Win version. I only think the window required for the PC that the application will be declare.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|