🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #8747

Re: calling host executable functions/methods from a dll

#8747
From: Andrue Cope [TeamB]
Date: Wed, 22 Sep 2004 15:43
25 lines
2111 bytes
Roger Warren wrote:

> is there any side-effects of doing this? is there any reason why i
> shouldn't declare every member function as virtual?

Calling a virtual method is slightly slower than calling a static
method because the CPU has to read the function pointer before it can
jump to it. It will also likely impact register usage within the
function. With modern CPUs neither is likely to be an issue unless you
are in a very tight loop for an intensive and complex process.

The only drawback in most cases would be a reduction in
maintainability. Virtual methods look like they are designed to be
overridden so making all your methods virtual might invite later
developers to attempt something they shouldn't.

> i do not plan on calling anything else in my main executable from 
> other dll's, 

That's what you say now. Tell me again in ten years :)

-- 
Andrue Cope [TeamB]
[Bicester, Uk]
http://info.borland.com/newsgroups/guide.html
Technical Details
Message-ID: <41519d8e$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed-east.nntpserver.com!nntpserver.com!chi1.usenetserver.com!atl-c02.usenetserver.com!news.usenetserver.com!peer01.cox.net!cox.net!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <41516f76@newsgroups.borland.com> <41518884@newsgroups.borland.com> <41518df4$1@newsgroups.borland.com> <41519776@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,61cd17292f50f8cb
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Andrue Cope [TeamB]" <no.spam@not.a.valid.address>
Subject: Re: calling host executable functions/methods from a dll
Newsgroups: borland.public.cppbuilder.nativeapi
References: <41516f76@newsgroups.borland.com> <41518884@newsgroups.borland.com> <41518df4$1@newsgroups.borland.com> <41519776@newsgroups.borland.com>
User-Agent: XanaNews/1.16.4.6
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 217.207.223.34
Message-ID: <41519d8e$1@newsgroups.borland.com>
Date: 22 Sep 2004 08:43:10 -0700
X-Trace: newsgroups.borland.com 1095867790 217.207.223.34 (22 Sep 2004 08:43:10 -0700)
Lines: 25
X-Authenticated-User: acope
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed-east.nntpserver.com!nntpserver.com!chi1.usenetserver.com!atl-c02.usenetserver.com!news.usenetserver.com!peer01.cox.net!cox.net!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail