🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: adding a .def file to a c++ dll

#392
From: Ed Mulroy [TeamB]
Date: Sun, 20 Apr 2008 15:26
22 lines
1911 bytes
You just add the module definition file to the project and make sure that it 
has the extension .def.

There are a lot of things that can be adjusted and/or specified in such a 
file but for exporting a function I think __declspec(dllexport) is all you 
need to declare something to be placed into the DLL's export table.

Public names for C++ functions are more complex due to the function argument 
list.  The actual name may vary across compilers and versions of compilers. 
Because of that it is better to export functions as extern "C".  In my code 
I also declare them as WINAPI (macro for __stdcall), an efficient calling 
convention that mimics what Windows uses for most of its functions.

.  Ed

> Sean Farrow wrote in message
> news:480b4159@newsgroups.borland.com...
>
> What isthe best way in c++ builder 2007 to add a .def file to export 
> functions.
> or should I just use __dll_dllexport. These are c++ functions. do I need 
> to declare them as extern "c"
Technical Details
Message-ID: <480b60b2$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!eweka.nl!lightspeed.eweka.nl!feeder.erje.net!news.isoc.lu!newsgroups.borland.com!not-for-mail
References: <480b4159@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,c72827871f7ef0e4
X-Google-Attributes: gid10cc67,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Ed Mulroy [TeamB]" <dont_email_me@bitbuc.ket>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <480b4159@newsgroups.borland.com>
Subject: Re: adding a .def file to a c++ dll
Date: Sun, 20 Apr 2008 11:26:40 -0400
Lines: 24
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 71.77.48.179
Message-ID: <480b60b2$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1208705202 71.77.48.179 (20 Apr 2008 08:26:42 -0700)
X-Authenticated-User: edmulroy
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!eweka.nl!lightspeed.eweka.nl!feeder.erje.net!news.isoc.lu!newsgroups.borland.com!not-for-mail