?
Solved

TrackMouseEvent

Posted on 1998-04-16
7
Medium Priority
?
427 Views
Last Modified: 2013-12-03
in winuser.h this is defined, I am using VC++5 dev. studio.
some how I get
error C2065: 'TrackMouseEvent' : undeclared identifier

that means I have to define some settings in my project menu
I am on a NT machine so this should let me use this API,
how ?
0
Comment
Question by:has
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 150 total points
ID: 1412812
It does not matter what type of machine your are on.  What matters is what the target machine for the application is.  You must indicate that this appliucation is for windows NT
0
 
LVL 22

Expert Comment

by:nietod
ID: 1412813
To indicate that an application target is windows NT, I think you just need to #define NT_INCLUDED.
0
 

Author Comment

by:has
ID: 1412814
what I meant was once I define and link properly,
the TrackMouseEvent will function, will not return
not implemented error. (remember it only works in 98, nt not
on 95) so that is what i mean. but the problem is to
compile and link it properly with certain settings.
I guess if you look at winuser.h you may tell what is
needed. it is strange that it knows the structure but
not the function, see below

// end_r_winuser

typedef struct tagTRACKMOUSEEVENT {
    DWORD cbSize;
    DWORD dwFlags;
    HWND  hwndTrack;
    DWORD dwHoverTime;
} TRACKMOUSEEVENT, *LPTRACKMOUSEEVENT;

WINUSERAPI
BOOL
WINAPI
TrackMouseEvent(
    LPTRACKMOUSEEVENT lpEventTrack);
this is from winuser.h, so in my project TRACKMOUSEEVENT
is recognized no problem, but just below it TrackMouseEvent
is not recognized ?? may be because of WINUSERAPI use, I dont know that is why I asked the question, any ideas ?


0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

Author Comment

by:has
ID: 1412815
by the way if I directly include
extern "C" WINUSERAPI BOOL WINAPI TrackMouseEvent(LPTRACKMOUSEEVENT lpEventTrack); in my own header
it works. but I need to know what makes is not working
from winuser.h
0
 
LVL 22

Expert Comment

by:nietod
ID: 1412816
the include files define structures for every version of windows (NT, 95, 3.1) because your program can create instances of these structure on any computer.  That is, you can create a structure regardless of what operating system you are running on.  However, the provedures provided by the operating system vary from system to system, so they are not always defined.  On a windows 95 computer you can create a TRACkMOUSEEVENT structure (and use it for whatever you want), but you cannot call TrackMouseEvent() because it is not provided by the operating system.

Does this answer your question?  I'm having a hard time understanding you.
0
 

Author Comment

by:has
ID: 1412817
For some API calls, you can call them but they may simply return false or null what ever (not implemented) when they function. but this does not prevent you compiling your program. such as
this one. any way i solved my problem, thanks.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1412818
It seems like you are confusing different issues.  

You say
  this does not prevent you compiling your program

What matters at compile time is the target OS.  I can compile a program that is targeted for NT on a 95 machine.  That program can use NT specific procedures and it will compile fine.  I will not be able to run it however.  It will only run on NT.

You also say
   For some API calls, you can call them but they may simply return false or null what ever (not implemented).

This is not true.  If you application contains calls to API procedures that are not available on the operating system it runs on the application will not run.  That is, this error will be detected at load time and the application will never execute.  For example if you use a NT only procedure and try to run under 95, The program will not run.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question