Subject Re: [firebird-support] Re: Problem with Classic Server and UDF
Author Helen Borrie
At 11:27 PM 13/06/2006, you wrote:
>While waiting for an answer, I tried several things around my UDFs
>and found out, why the error occures.
>
>Don't understand, why it is a problem for the classic server and not
>for the superserver, but here is the solution:
>
>This was the function that worked well with superserver (I know, not
>very usefull function ;-), but it's just an example):
>
>function donothing (var input : integer) : integer; stdcall;
>
>begin
>result := input;
>end;
>
>And so it must be, to work with classic server:
>
>function donothing (var input : integer) : integer; cdecl; export;
>
>begin
>result := input;
>end;
>
>The key was, that I had to replace "stdcall;" with "cdecl; export;"
>
>Don't know why, but it works.

I don't know why it worked in Superserver. You should never use the
stdcall calling convention in UDFs at all.

./heLen