Re: How to export afunction in class?



No, but I rarely find that I need stdcall when calling the exported functions of a DLL.
Actually, let me rephrase that: I've never found a need to use stdcall when calling the
functions of a DLL. I trade off a couple extra instructions against the convenience and
robustness of using CDECL, and it means there is no real value to stdcall. So I've never
worried about it.

Why does stdcall make a difference? Unless you are in the inner loop of some intense
computation and calling your DLL on every iteration, the performance issue would never
matter. I'll trade off performance vs. convenience at this level any time, because I
don't need the performance when going into a DLL.
joe

On Wed, 07 Feb 2007 07:34:46 GMT, MrAsm <mrasm@xxxxxxx> wrote:

On Wed, 07 Feb 2007 01:07:02 -0500, Joseph M. Newcomer
<newcomer@xxxxxxxxxxxx> wrote:

In that case, you could use CDECL and it will all work right anyway.
joe

You're right that CDECL doesn't decorate names, but it has different
calling convention than STDCALL, so if I want the STDCALL's calling
conventions (e.g. called function pops its own arguments from the
stack) and I want no name decoration, I must use .DEF files.

Or is there another way to have STDCALL calling convention and no
decoration *without* using .DEF files?

Thank you
MrAsm
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: using the CWegPage.dll
    ... It is using the WINAPI (_stdcall) calling ... > The source code for the DLL is on that page and is in this link to the zip ... >> change the calling convention to that which VB can handle. ... >>> The goal is to put an internet explorer web browswer on my form. ...
    (microsoft.public.vc.language)
  • Re: using the CWegPage.dll
    ... It is using the WINAPI (_stdcall) calling ... > The source code for the DLL is on that page and is in this link to the zip ... >> change the calling convention to that which VB can handle. ... >>> The goal is to put an internet explorer web browswer on my form. ...
    (microsoft.public.vb.winapi)
  • Re: Possible causes of Err 483 "Cant find DLL entry point"?
    ... >Because of the underscore you will have to use the Declare Function ... It also appears the author is using _stdcall. ... confirms that the DLL was compiled as _stdcall (which is unsual, ... __stdcall calling convention." ...
    (microsoft.public.vb.general.discussion)
  • Re: Calling procedure in a DLL
    ... but I get errors when calling the ... library TestLib; ... And where is that told to use StdCall? ... If you want to know why, then it is because it stops your DLL being ...
    (alt.comp.lang.borland-delphi)
  • Re: The Lib debate
    ... >>Calling Functions in a DLL is a comletely different thing. ... For shared object libraries you have to call ... I have been told that zip comes with a Lib only. ...
    (alt.lang.asm)