From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,be6e28f854440947 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!news.tornevall.net!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: How to get the mouse position with JEWL? Date: Wed, 20 Oct 2010 19:59:16 -0700 Organization: TornevallNET - http://news.tornevall.net Message-ID: References: NNTP-Posting-Host: 1433817befd48d53fdd40a32c211251e Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: 0fe3a9483bf63834347eaa1f374466f1 X-Complaints-To: abuse@tornevall.net User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.12) Gecko/20100915 Thunderbird/3.0.8 X-Complaints-Language: Spoken language is english or swedish - NOT ITALIAN, FRENCH, GERMAN OR ANY OTHER LANGUAGE! In-Reply-To: X-UserIDNumber: 1738 X-Validate-Post: http://news.tornevall.net/validate.php?trace=0fe3a9483bf63834347eaa1f374466f1 X-Complaints-Italiano: Non abbiamo padronanza della lingua italiana - se mandate una email scrivete solo in Inglese, grazie X-Posting-User: 0243687135df8c4b260dd4a9a93c79bd Xref: g2news2.google.com comp.lang.ada:15611 Date: 2010-10-20T19:59:16-07:00 List-Id: On 10/20/2010 03:51 PM, tmoran@acm.org wrote: > This works for me for Windows > type Points is record > x,y : interfaces.c.int; > end record; I'd add pragma Convention (C, Points); just to be safe. > type bool is new interfaces.c.int; > function GetCursorPos(point : access points) return bool; (Point : in Points) should work just as well, and has the advantages that > pragma import(stdcall,GetCursorPos, "GetCursorPos"); > current : aliased points; you don't need "aliased" > ... > if getcursorpos(current'access) = 0 then and you don't need 'access. This works because of ARM B.3: "An Ada parameter of a record type T, of any mode, other than an in parameter of a type of convention C_Pass_By_Copy, is passed as a t* argument to a C function, where t is the C struct corresponding to the Ada type T." It is a little confusing because an "in" parameter is modified. -- Jeff Carter "You empty-headed animal-food-trough wiper." Monty Python & the Holy Grail 04