| Subject | udf with paramters problem | 
|---|---|
| Author | keith prosser | 
| Post date | 2017-08-11T09:09:58Z | 
Has anyone had probems with udfs written in Delphi7?   I'm getting serious crashes when I try to pass  parameters - but a udf returning an integer with input  parameters works fine.
I am running 32-bit Firebird on a 64bit win 7 machine.
I'm fairy sure its to with pointers and data.
The source code is
interface
function AddFunction(var i: integer):Integer;stdcall;
function mynow():Integer;stdcall;
implementation
function AddFunction(var i: integer): integer; stdcall;
begin
result:=i+1; // this crashes
end;
begin
result:=i+1; // this crashes
end;
function mynow():Integer;
begin
    result:=9999;  // this works
end;
and the sql is
DECLARE EXTERNAL FUNCTION F_ADDFUNCTION
Integer
RETURNS Integer BY VALUE
ENTRY_POINT 'AddFunction'
MODULE_NAME 'FISHYFUNCS.DLL';
Integer
RETURNS Integer BY VALUE
ENTRY_POINT 'AddFunction'
MODULE_NAME 'FISHYFUNCS.DLL';
DECLARE EXTERNAL FUNCTION MYNOW
RETURNS Integer BY VALUE
ENTRY_POINT 'mynow'
MODULE_NAME 'FISHYFUNCS';
RETURNS Integer BY VALUE
ENTRY_POINT 'mynow'
MODULE_NAME 'FISHYFUNCS';
Mynow works, f_addfunction doesn't.