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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,27200915cbff176 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-19 18:12:43 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!newsfeed2.easynews.com!easynews.com!easynews!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!usenet-fr.net!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Problem with C function pointers Date: 19 Dec 2003 21:07:13 -0500 Organization: Cuivre, Argent, Or Message-ID: References: <963c4dec.0312191413.15c9cb08@posting.google.com> NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: melchior.cuivre.fr.eu.org 1071886048 46860 80.67.180.195 (20 Dec 2003 02:07:28 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Sat, 20 Dec 2003 02:07:28 +0000 (UTC) Cc: comp.lang.ada@ada-france.org To: skibochka@yahoo.com (Andrew Skiba) Return-Path: In-Reply-To: <963c4dec.0312191413.15c9cb08@posting.google.com> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 X-Virus-Scanned: by amavisd-new-20030616-p5 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.3 Precedence: list List-Id: Gateway to the comp.lang.ada Usenet newsgroup List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:3603 Date: 2003-12-19T21:07:13-05:00 skibochka@yahoo.com (Andrew Skiba) writes: > The question is how do I eliminate the check? You don't want to eliminate the check! but you do want to solve the problem. > type SetCooperativeLevel_func is access function > (thiz:IDirectFBCore_ptr; level:CooperativeLevel) return DFBResult; > pragma Convention (C, SetCooperativeLevel_func); -- this does not help > type IDirectFBCore is record > ... > SetCooperativeLevel:SetCooperativeLevel_func; -- this field > -- points to some C function inside DirectFB library > ... > end record; > pragma Convention (C, IDirectFBCore); -- this does not help, too :-( > thiz:IDirectFBCore; > f:SetCooperativeLevel_func; > > f:=thiz.SetCooperativeLevel; -- here exception is raised Hmm. At this point "thiz" has the value "null". What do you expect? I suspect you left out some code, that sets "thiz". please post a small compilable example, if possible. Have you tried running under gdb, and examining "thiz"? Just out of curiosity, what does DirectFB do? -- -- Stephe