Article View: borland.public.cppbuilder.nativeapi
Article #9077Re: CALLBACK Functions
From: McKool
Date: Fri, 13 Aug 2004 08:29
Date: Fri, 13 Aug 2004 08:29
45 lines
2705 bytes
2705 bytes
ok.. i have a protocol document with the following prototype:
UINT32 InitBoard( UINT16 BoarSegment,
t_UsrIntHdlr CallbackfunctionHandler,
t_UsrExHdlr ExeptionFunctionHandler);
This is the function which i try to implement in my DLL. The t_UsrIntHdlr
function is a Callback function from other application.. That application
has that function defined as:
typedef void (CALLBACKATTR *t_UsrRxIntHdlr)( UINT16 count, CAN_OBJ FAR *
p_obj);
typedef void (CALLBACKATTR * t_UsrExcHdlr)( FUNC_NUM func_num, INT32
err_code, UINT16 ext_err,char * message );
I should use the first function to notify the application when the dll is
able to give it some values, or the second when an exception occur. So,
how do I have to cast the handler?. I tried to declare the two typedef but
i get errors, so how can I cast and call the function whit the handler
received in the InitBoard function?.
I never made something like that, i have no idea. Thanks in advance for all
what you can tell me about that.
KW ,.
"Andrue Cope [TeamB]" <no.spam@spammy.com> schrieb im Newsbeitrag
news:411c7648@newsgroups.borland.com...
> McKool wrote:
>
> > My question is,
> > How can I define or call this function in the Dll? how can a make the
> > casting for that address function and after that call that function?.
>
> We can't answer that without you showing us some code. At the very
> least we need to see the declaration for the callback. Is there a
> function prototype you can post here?
>
> --
> Andrue Cope [TeamB]
> [Bicester, Uk]
> http://info.borland.com/newsgroups/guide.html
Technical Details
Message-ID:
<411c7b53$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!62.253.162.219.MISMATCH!news-out.ntli.net!newsrout1.ntli.net!news-in.ntli.net!ntli.net!border2.nntp.ams.giganews.com!nntp.giganews.com!news.zanker.org!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<411c6647@newsgroups.borland.com> <411c7648@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,57461044372eb966 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "McKool" <kenethw@peak-system.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <411c6647@newsgroups.borland.com> <411c7648@newsgroups.borland.com> Subject: Re: CALLBACK Functions Date: Fri, 13 Aug 2004 10:29:27 +0200 Lines: 47 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 NNTP-Posting-Host: 213.157.13.214 Message-ID: <411c7b53$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1092385619 213.157.13.214 (13 Aug 2004 01:26:59 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!62.253.162.219.MISMATCH!news-out.ntli.net!newsrout1.ntli.net!news-in.ntli.net!ntli.net!border2.nntp.ams.giganews.com!nntp.giganews.com!news.zanker.org!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail