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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Declaring GLADE callbacks with G_MODULE_EXPORT. Date: Thu, 31 Mar 2016 11:34:25 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <1f780a7e-1972-4f8f-9832-02fbf2bd920a@googlegroups.com> <68f13969-e3ff-45ae-b797-4f7bfc96203b@googlegroups.com> NNTP-Posting-Host: bqgfK7NL3xTHnr0WRaLl4g.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:29937 Date: 2016-03-31T11:34:25+02:00 List-Id: On 31/03/2016 11:21, George J wrote: > On Thursday, 31 March 2016 12:11:12 UTC+3, George J wrote: >> Hi all! I've got a problem with connecting signals with >> Builder.Connect_Signals. It's said in description that "...When >> compiling applications for Windows, you must declare callbacks with >> G_MODULE_EXPORT...". So my question is "how to do this?" and what does >> it mean? > > For example how I can link this way procedure like > --------------------------------------------------------- > procedure Test(Self:Gtk_Some_Object) is > begin > null; > end Test; > --------------------------------------------------------- > I couldn't find any example for Ada with this declaration, and really > can't understand, how I can do it. Thanks. I don't use GLADE, of course, so it is just guessing. Under Windows G_MODULE_EXPORT is likely DLL export used to bind to the procedure after loading the DLL. In Ada terms it must be pragma Export (C, Test, "Test"); or, if GLADE uses Windows API conventions: pragma Export (Stdcal, Test, "Test"); The external name "Test" is up to experiments. It could be "_test" or some Windows mangled name "Test@...". I have no idea what external names GLADE uses. An error message upon loading/linking should hint at it. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de