Solved

TrackMouseEvent

Posted on 1998-04-16
7
416 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

746 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

10 Experts available now in Live!

Get 1:1 Help Now