Subject | Creating UDF - stdcall vs cdecl |
---|---|
Author | hamacker |
Post date | 2014-10-07T12:21:20Z |
Hi everyone,
I am studying how to create UDFs on Firebird, but there is a thing that I can not understand.
All functions are exported as stdcall:
function Teste(sVar:PAnsiChar; iVar:Integer):PAnsiChar; stdcall ;
I dont use string, only pAnsiChar, Integer and Double.
Ok, at this point, but when register inside Firebird and execute, the app (flamerobin or ibexpert) crash.
Then, I change to export function DLL as cdecl and change Integer type to Integer as Pointer:
type PInteger = ^Integer;
function Teste(sVar:PAnsiChar; iVar:PInteger):PAnsiChar; cdecl;
runs fine, but I have very difficult to handle with pointers (hello pascal).
I canĀ“t make a simple 'hello word' using stdcall functions. Even copy samples over internet.
I use Delphi XE5 and FB 2.5.3.
I would like to know if is possible to work writting UDFs as stdcall or I have to adapter with cdecl and pointers to make my own UDFs.
Thx,