Article View: borland.public.cppbuilder.nativeapi
Article #11242Re: Run Time Dynamic linking
From: Ed Mulroy [TeamB]
Date: Fri, 20 Feb 2004 19:10
Date: Fri, 20 Feb 2004 19:10
34 lines
2420 bytes
2420 bytes
Thanks for the quote from the C standard. For C I work from the draft
standard but a little search turned up the same thing although with a
different footnote number. (I bought the C++ standard [multiple times!] but
haven't yet decided to spend yet more money on the C one.) Now that I've
looked the C++ standard implies the same thing although I couldn't find it
as clearly stated as in the C one.
. Ed
> Alan Bellingham wrote in message
> news:glbc305oe8fpeo2u3mnf0s8eajufdmtbrh@4ax.com...
>
> To quote a footnote from the current C standard:
>
> 85) A cast does not yield an lvalue.
>
> And since assignment requires an lvalue as its target, this rather
> implies that the cast-on-the-left method isn't actually legal.
>
> I suspect that it's a bug in early compilers that got left in
> because it's too useful for such code.
>
> I actually use a template:
>
> template<typename FuncType> vool
> WireupFunction(HINSTANCE Inst, FuncType& FnPtr, char const* FnName)
> {
> FnPtr = reinterpret_cast<FuncType>(GetProcAddress(Inst, FnName));
> return (FnPtr != 0);
> }
>
> WireupFunction(m_Inst, ClearPrintString, "ClearPrintString");
>
> Once the template exists, it's actually less typing.
Technical Details
Message-ID:
<40365ba3$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4034d732$1@newsgroups.borland.com> <4034e538$1@newsgroups.borland.com> <4034e949$1@newsgroups.borland.com> <40350424$1@newsgroups.borland.com> <p8al49eo5xi$.1rbxmasbh351g.dlg@40tude.net> <40361a16$1@newsgroups.borland.com> <glbc305oe8fpeo2u3mnf0s8eajufdmtbrh@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,c9838237a73aa85e X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-02-20 11:40:17 PST From: "Ed Mulroy [TeamB]" <dont_email_me@bitbuc.ket> Newsgroups: borland.public.cppbuilder.nativeapi References: <4034d732$1@newsgroups.borland.com> <4034e538$1@newsgroups.borland.com> <4034e949$1@newsgroups.borland.com> <40350424$1@newsgroups.borland.com> <p8al49eo5xi$.1rbxmasbh351g.dlg@40tude.net> <40361a16$1@newsgroups.borland.com> <glbc305oe8fpeo2u3mnf0s8eajufdmtbrh@4ax.com> Subject: Re: Run Time Dynamic linking Date: Fri, 20 Feb 2004 14:10:24 -0500 Lines: 36 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 24.74.175.102 Message-ID: <40365ba3$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1077304227 24.74.175.102 (20 Feb 2004 11:10:27 -0800) X-Authenticated-User: edmulroy Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail