PDA

Click to See Complete Forum and Search --> : coords handles?


joey o.
Jan 7th, 2002, 11:55 AM
I might be wrong but maybe someone here can help...
Is there a simpler way to use (get, store, and pass) a co-ordinate(X,Y) as a Long without having to break it down and build it again using typepointAPI? It just seams redundant to me to get the point (probably stored as a long) have vb turn it into x,y and then store it as a userdefined type. Shouldn't I be able to just get and use the same coord as one long number without the conversions?

opus
Jan 7th, 2002, 02:50 PM
Why should that be a problem. I'm using a Type to store x,y datas. In the code I can easily see what is ment (Position.x Position.y). You're right for the storing, but that's no problem to me to store them seperatly. And it is the same way for the storing as in the code, you can more easily understand the values.

jim mcnamara
Jan 7th, 2002, 03:36 PM
FYI - if you learn C++ you'll discover the POINT structure - which is the same as the dataype PointAPI in VB.

In memory is really two two-byte integers. The PointAPI UDT is a copy of what is in memory.

Now, what specifically is the issue in working with PointAPI?

opus
Jan 7th, 2002, 04:01 PM
Why do call this UDT PointAPI, it is not an API. That's confusing!

CornedBee
Jan 8th, 2002, 10:37 AM
from windef.h:
typedef struct tagPOINT
{
LONG x;
LONG y;
} POINT, *PPOINT, NEAR *NPPOINT, FAR *LPPOINT;

POINT contains two 4-byte signed integers, equivalent to Long in VB.

joey o.
Jan 8th, 2002, 11:52 AM
The reason I wanted to know this is I'm making a keyboard and mouse movement and action recording program as my last hurrah to VB before moving on to C++ and it would keep my file size smaller if I could record mouse movements as a long without having to type them and assign it as a long instead of x,y. Thanks for the help confirming it can't be done.