Article View: borland.public.cppbuilder.nativeapi
Article #6955Re: float MyAdd(float A,float B); int MyAdd(int A, int B); both in one DLL
From: Edward Diener
Date: Sat, 05 Jul 2003 14:15
Date: Sat, 05 Jul 2003 14:15
18 lines
2118 bytes
2118 bytes
Remy Lebeau (TeamB) wrote: > "Miem Chan" <miemchan@yahoo.com> wrote in message > news:3f06547e@newsgroups.borland.com... > >> The problem (and my question) is how we can put >> both of these MyAdd functions in to a single DLL >> and expect to call proper MyAdd function depending >> on the parameters passed ? > > You can't. DLLs don't support function overloading at all. You have > to name each function differently. This just isn't true. Because of name-mangling in C++, you can have function overloading in DLLs. Each function with the same base name gets a unique name-mangled name because of its different parameter list. Name mangling doesn't work only if the programmer wants to use extern "C" in order to have the functions in the DLL called from other languages or other C++ implementations. Only in this latter case is your statement above correct.
Technical Details
Message-ID:
<3f06de1f$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3f06547e@newsgroups.borland.com> <3f0681f5$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 102541,81e91db7883b82d8 X-Google-Attributes: gid102541,public X-Google-Thread: 10cc67,81e91db7883b82d8 X-Google-Attributes: gid10cc67,public X-Google-Thread: 10db1e,81e91db7883b82d8 X-Google-Attributes: gid10db1e,public X-Google-ArrivalTime: 2003-07-05 07:27:02 PST From: "Edward Diener" <eddielee@tropicsoft.com> Newsgroups: borland.public.cppbuilder.nativeapi,borland.public.cppbuilder.oodesign,borland.public.cppbuilder.students References: <3f06547e@newsgroups.borland.com> <3f0681f5$1@newsgroups.borland.com> Subject: Re: float MyAdd(float A,float B); int MyAdd(int A, int B); both in one DLL Date: Sat, 5 Jul 2003 10:15:31 -0400 Lines: 20 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.1165 NNTP-Posting-Host: 66.245.8.210 Message-ID: <3f06de1f$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1057414687 66.245.8.210 (5 Jul 2003 07:18:07 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail