🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Using __stdcall

#1237
From: Sue King
Date: Tue, 16 Oct 2007 08:06
50 lines
3319 bytes
Sue King wrote:

Thanks Bob and Jeff.

In answer to Jeff's question, I do have the source to the dll mangling 
the names, but do not wish to move it as it contains embedded sql code 
and the original ide supports the appropriate preprocessor (Open Watcom 
and Sybase sql).  If really necessary it can be changed, but I would 
really rather leave it as is, as it is simpler to make and is very 
rarely changed.

I think I am on top of it now thanks to your help and the previous posts.

What I have found is that by running impdef followed by implib I can 
create an appropriate lib file to use instead of the one created by OW. 
    There were no manual changes required.  The OW lib pointed a mangled 
name to a mangled name and that works fine for OW compiling and linking. 
  The RAD Studio lib points 'clean' name to mangled name, and RAD C now 
compiles and links (and runs although I haven't done in depth testing).

Most of the application is actually written in Delphi, and it doesn't 
really matter which way the names are specified, as that can be given 
directly by linking a Delphi procedure to the dll one directly 
specifying the dll and entry point.  The issue is with a C dll that I 
can't leave with OW as it uses rpc code and that has changed with new 
security with later Windows versions and I am not expert enough with C 
to work out the changes needed to OW to make it work with new Microsoft 
libraries and procedures. (And I have to try out my new RAD C anyway)

On looking at some other code (this was all written by other people no 
longer here), I found that there is another solution.  In this code, the 
procedures are defined with a pragma as follows (I don't completely 
understand it, but you probably will).

#pragma aux __torrens "*"\
   parm routine [] \
   value struct struct caller [] \
   modify [eax ecx edx]
#pragma AUX (__torrens) Function
int __export Function(short limit);

Is this just as valid ?  Will the memory still be freed properly ?  I'm 
not really familiar with assembler (unfortunately the only assembler I 
really got the hang of was old IBM 360/370 mainframe assembler, showing 
my age!!).

I prefer the lib method, as it makes the C easier to follow.

Regards
Sue
Technical Details
Message-ID: <471470cc$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <47129b93$1@newsgroups.borland.com> <p695h3tbk1cc4q0o89v2nqj1u41e68hlct@4ax.com> <4712f1ad$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,4be438fa70c4738f
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Tue, 16 Oct 2007 18:06:45 +1000
From: Sue King <sue@torrensbs.com.au>
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Using __stdcall
References: <47129b93$1@newsgroups.borland.com> <p695h3tbk1cc4q0o89v2nqj1u41e68hlct@4ax.com> <4712f1ad$1@newsgroups.borland.com>
In-Reply-To: <4712f1ad$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 203.34.140.74
Message-ID: <471470cc$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1192521932 203.34.140.74 (16 Oct 2007 01:05:32 -0700)
Lines: 51
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail