[fpc-pascal] Writing DLLs to by used in Excel VBA code
    Marc Santhoff 
    M.Santhoff at web.de
       
    Sun Dec 13 18:40:56 CET 2015
    
    
  
On Fr, 2015-12-11 at 17:15 -0200, luciano de souza wrote:
> Hello all,
> 
> I want to use a DLL writen in Pascal to provide functions for a Excel VBA code:
> 
> The example code of my DLL is:
> library CE;
> {$mode objfpc}
> 
> uses
> Sysutils;
> 
> function level(x1, x2: integer): integer; cdecl; export;
> begin
> result := x1 + 2*x2;
> end;
> 
> 
> exports
> level name 'level';
> end.
If you're on windows the declaration "cdecl" should be "stdcall".
HTH,
Marc
-- 
Marc Santhoff <M.Santhoff at web.de>
    
    
More information about the fpc-pascal
mailing list