Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 27 MAY 2006 03:52:58AM George Farrugia wrote:

In this forum I read somewhere that the following piece of code …

 DECLARE SUBROUTINE GetCursorPos, Parse_Struct
 DECLARE FUNCTION Struct_To_Var
 XY=STR(\00\, 4)
 GetCursorPos(XY)
 XY=Struct_To_Var(XY, "POINT")
 X =XY
 Y =XY

returns the X and Y coordinates.

I'm managing to obtain the X coordinate but the Y coordinate is always null. I then replaced the line containing Struct_To_Var with this one:

 Parse_Struct(XY, "POINT", X, Y)

but still, I can only get the X coordinate; the Y coordinate is always null. What could I be doing wrong?


At 27 MAY 2006 07:48AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

George,

That looks like 16-bit code. A Win32 POINT is 8 bytes (2 x 4-byte integers), not 4.

First thing - make sure the POINT structure definition is correct. Use the DEFINE_STRUCT window to check that both elements are two signed long integers.

Next use the blank_struct() function to create the memory for the point structure.

   DECLARE SUBROUTINE GetCursorPos, Parse_Struct
   DECLARE FUNCTION Struct_To_Var, blank_Struct

   XY=blank_struct( "POINT" )
   GetCursorPos(XY)
   XY=Struct_To_Var(XY, "POINT")
   X=XY
   Y=XY

The Sprezzatura Group

World leaders in all things RevSoft


At 27 MAY 2006 10:43AM George Farrugia wrote:

Once again, thanks a lot Sprezz. You make it look so easy :)

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/8c7624358e432c978525717b002b4d8a.txt
  • Last modified: 2024/01/04 21:00
  • by 127.0.0.1