Solved

TrackMouseEvent

Posted on 1998-04-16
7
422 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 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem updating Access table using VB code 8 58
Alternative to visual sourcesafe 2 141
Need more details 5 184
reboot server with scheduled time and week base 4 65
zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

726 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