
Используя образцы примеров, написал DLL (UDFColors.dll), для разбора цвета на составляющие:
unit BreakColors;
interface
implementation
function GetRed(Color:Integer):Integer ; stdcall ;
begin
result:=Color and $FFFFFF00;
end;
function GetGreen(Color:Integer):Integer ; stdcall ;
begin
result:=(Color shr 8 )and $FFFFFF00;
end;
function GetBlue(Color:Integer):Integer ; stdcall ;
begin
result:=(Color shr 16 )and $FFFFFF00;
end;
end.
Успешно ее создал и поместил в interbase_home/UDF.
Успешно скриптом объявил функции в БД:
declare external function GRed
integer
returns integer
entry_point 'GetRed' module_name 'UDFColors.dll';
declare external function GGreen
integer
returns integer
entry_point 'GetGreen' module_name 'UDFColors.dll';
declare external function GBlue
integer
returns integer
entry_point 'GetBlue' module_name 'UDFColors.dll';
Но дальше не работает! Например, при создании View:
CREATE VIEW Colors (PCOLORFACE,RED ,GREEN,BLUE )AS
select DISTINCT PCOLORFACE,
GRED (PCOLORFACE),
GGREEN (PCOLORFACE),
GBLUE (PCOLORFACE)
from POLITOP, SCENE_POLITOP
where SP_SID IS NULL AND SP_PID= PID;
Выдает:
Invalid request BLR at offset 73
function GRED is not defined
module name or entrypoint could not be found
Где "копать"?