Re: ffidl and pascal calling convention

From: Helmut Giese (hgiese_at_ratiosoft.com)
Date: 10/28/03


Date: Tue, 28 Oct 2003 19:59:39 GMT

On Tue, 28 Oct 2003 19:02:41 GMT, "Paul Battersby"
<batman42ca@yahoo.ca> wrote:

>I haven't found any reference to this in the documentation but what do I
>have to do to get ffidl and TCL to deal with a DLL that uses the pascal
>calling convention?
>
>TCL fails to find the DLL procedures when I try to use a DLL that used the
>pascal calling convention.
Hi Paul,
sorry, I cannot help you directly, but I am a bit surprised:
1) If calling conventions don't match, your program will most likely
crash - and not report a 'not found' error.
2) All of Windows is compiled using Pascal calling conventions (IIRC)
and
3) I seem to remember that people reported sucess calling into plain
Windows DLLs via ffidl.
So maybe the problem is somewhere else? Maybe the functions aren't
exported by name but only by index? Or you are not writing the name
'comme il faut': Pascal itself is not case sensitive but Windows is,
so you have to spell the name like it is spelled in the DLL. (Open it
with a hex viewer and search for the name you have been told to use
ignoring case.) Or some other reason, which I can't think of right now
???

HTH
Helmut Giese



Relevant Pages

  • Re: Marshal callback containing unsigned char * in signature
    ... It is possible to change the calling convention for a callback to __cdecl, ... This is a third party dll that I'm ...
    (microsoft.public.dotnet.framework.interop)
  • Re: Linking to DLL - update
    ... This error is usually caused by a mismatch in calling convention. ... I am now successfully calling the function in the DLL - the ... jumps to the subroutine and pushes the return address on the stack. ... case the callee does that. ...
    (microsoft.public.win32.programmer.tools)
  • Re: procedure doesnt works if the program compiled to native code...
    ... Even with an incompatible calling convention the function in the DLL is ... Incomaptibility of the calling convention is something that matters only ... since VB maybe corrects the stack pointer after it has detected the ...
    (microsoft.public.vb.winapi)
  • Re: Calling unmanaged C++ from C#
    ... Have you checked the calling convention setting in the VS2003 dll project. ... >> string strXMLFile, ...
    (microsoft.public.dotnet.framework.interop)
  • Re: ffidl and pascal calling convention
    ... >> Windows DLLs via ffidl. ... >name, kept the TCL code the same, and TCL reported that if couldn't find my ... >parameter passing such that the parameters get through to my DLL but when my ... >If I don't specify the PASCAL calling convention, I can test my DLL from ...
    (comp.lang.tcl)