🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Call C++ func in DLL from Delphi

#11980
From: Remy Lebeau (TeamB)
Date: Fri, 02 Jan 2004 02:03
24 lines
1582 bytes
"Muzzy" <leyandrew@yahoo.com> wrote in message
news:3ff4af1f$1@newsgroups.borland.com...

> How do i declare a 'procedure' variable in delphi to call the func?

    function vpnstart(PChar AKeyTable): bool; stdcall; external
"YourDLLName";

> How do i wrap _stdcall?

You don't need to.  Delphi has native support for __stdcall via the
'stdcall' keyword.

> Also i am not sure if/for what purpose i need "C" in c++ func

I assume you are referring to extern "C"?  If so, it removes the mangling
from the exported function's name.  Without it, the function name would look
more like this instead:

    "YourFunctionName@34"


Gambit
Technical Details
Message-ID: <3ff4d00c$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3ff4af1f$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,e6956f14e65c6d27
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-01-01 18:09:24 PST
From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3ff4af1f$1@newsgroups.borland.com>
Subject: Re: Call C++ func in DLL from Delphi
Date: Thu, 1 Jan 2004 18:03:07 -0800
Lines: 26
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: 67.22.139.199
Message-ID: <3ff4d00c$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1073008652 67.22.139.199 (1 Jan 2004 17:57:32 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail