Solved

TrackMouseEvent

Posted on 1998-04-16
7
418 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
  • 4
  • 3
7 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 50 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

930 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now