🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: __declspec(dllimport) in bpl

#3611
From: Alan Bellingham
Date: Mon, 22 May 2006 08:38
32 lines
1934 bytes
"Dmitry Konnov" <dmitry@weblinedesign.biz> wrote:

>I have set of methods and VCL classes in main executable of application,
>which I have to use inside bpl.
>
>In bpl code I declare methods implemented in main executable like this:
>
>extern "C"  TComponent * __declspec(dllimport) MyExeMethod();
>
>When I compiling bpl,  I get linker error
>Unresolved external MyExeMethod() refernced from ....

You can't do that. You can't export a function from the application and
import it into the DLL, because there's no export library produced by
the DLL.

You need to build your code up in layers. The bottom layer is DLLs that
don't require any other DLLs. Next up, you can have DLLs that only
require DLLs from lower layers. And so on up, until you get to the
application, which is where you stop - you can't have DLLs higher that
an app.

There look to be a couple of solutions:

a) pass pointers from the app to the DLL

b) pull the VCL classes out of your app and put them in the DLL.


Alan Bellingham
-- 
ACCU Conference: 11-14 April 2007 - Paramount Oxford Hotel
Technical Details
Message-ID: <frt27211skqg9gnbut06ho68n022q9btkm@4ax.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <447171ab@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,a1cb33bc02ad1dec
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Alan Bellingham <alanb@episys.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: __declspec(dllimport)  in bpl 
Date: Mon, 22 May 2006 09:38:18 +0100
Reply-To: alanb@episys.com
Message-ID: <frt27211skqg9gnbut06ho68n022q9btkm@4ax.com>
References: <447171ab@newsgroups.borland.com>
X-Newsreader: Forte Agent 3.3/32.846
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 193.129.251.253
X-Trace: newsgroups.borland.com 1148287098 193.129.251.253 (22 May 2006 01:38:18 -0700)
Lines: 32
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail