🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.borland
Article #3

Re: Calling ObjPascal Callback Routines from C++ DLL

#3
From: Steve Teixeira
Date: Wed, 30 Aug 1995 00:13
22 lines
1696 bytes
Bob White <bob@murkworks.com> wrote:
>I am trying to pass a callback for a Pascal (Delphi) procedure to a DLL written in 
>C++ and execute the callback from the DLL.  I can't seem to keep Windows stable 
>enough to track things down with TDW and I can't get a valid return value from 
>MakeProcInstance for any pascal procedures.  And Delphi (as far as I can tell) does 
>not allow you to export functions from within programs, only DLLs.
>
>I've read all the FAQs I could find and reviewed all the on-line tech journals I've 
>stumbled across, but no one seems to have addressed this issue.  The time of 
>desperation is near...
>
>Does anyone have an example of such a callback.  Prototypes and code examples for 
>both ends would be a great help... actually at this point, any inforation would be a 
>great help.
>

Make sure to give the Delphi proc the "export" directive.  Also, be sensitive to
parameter passing conventions: you may need to use the "cdecl" directive if the
C++ function prototype isn't declared to be PASCAL.

     -Steve Teixeira
      steixeir@borland.com
Technical Details
Message-ID: <420afj$2kg@druid.borland.com>
Path: arc1-ca.pugleaf.net!druid.borland.com!usenet
References: <41vrlt$139f@library.erc.clarkson.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!druid.borland.com!usenet
From: Steve Teixeira <steixeir@borland.com>
Newsgroups: comp.lang.pascal.borland,comp.lang.pascal.delphi.misc,comp.lang.pascal.misc,comp.lang.c++
Subject: Re: Calling ObjPascal Callback Routines from C++ DLL
Date: 30 Aug 1995 00:13:39 GMT
Organization: Borland International, Inc.
Message-ID: <420afj$2kg@druid.borland.com>
References: <41vrlt$139f@library.erc.clarkson.edu>
NNTP-Posting-Host: tex.borland.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 1.2b6 (Windows; I; 32bit)