🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.basic.visual.misc
Article #153

Re: DLL, VB and Borland C/C++

#153
From: Jeff Jenkins
Date: Thu, 22 Feb 1996 19:17
31 lines
1483 bytes
Robert Taylor wrote:
> 
> Sylvain Souche wrote:
> >
> > Hi,
> >
> > I am trying desperatly to call a DLL created with Borland C/C++ 4.5 in a
> > VB 3.0 application, but VB always complains about a so called "Bad
> > Calling Convention Error". This Error message is not very documented,
> > and Borland Help files are worth nothing, so...
> >
> > If anyone know about this problem, could you tell me.
> >
> > Thanks for e-mail replies
> >
> > --
> >         Sylvain Souche
> >         Sylvain.Souche@supaero.fr
> 
> You are probably not exporting the function correctly in the Borland C++
> DLL.  I am pretty sure that VB 3.0 requires imported functions to be
> 'FAR PASCAL'.
> 
> If you are not declaring the function as FAR PASCAL, it will default to
> 'CDECL'; which will cause the above mentioned error...
> 
> -- Bob T.

Also, make sure you don't have exception handling enabled for the DLL.

-- jrj
Technical Details
Message-ID: <312CC167.1237@wpo.borland.com>
Path: arc1-ca.pugleaf.net!druid.borland.com!usenet
References: <312A0334.AC5@supaero.fr> <312ABB01.60D@deltanet.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!druid.borland.com!usenet
From: Jeff Jenkins <jjenkins@wpo.borland.com>
Newsgroups: comp.lang.basic.visual.misc,comp.lang.c,comp.lang.c++
Subject: Re: DLL, VB and Borland C/C++
Date: Thu, 22 Feb 1996 11:17:59 -0800
Organization: Borland International
Message-ID: <312CC167.1237@wpo.borland.com>
References: <312A0334.AC5@supaero.fr> <312ABB01.60D@deltanet.com>
NNTP-Posting-Host: beastly.borland.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 2.0b5 (Win95; I)