supernewbie почему моя Функция нехрена не работает мм?.вот как делал:Фунцыя тесовая Str(N:Integer):String;
так вот тестил:
Оффтоп
delphi Код:
procedure Init;
begin
SendMSG(str(20));
end;
procedure Free;
begin
end;
begin
end.
Сам плагин:
Оффтоп
Delphi Код:
library Strin;
uses
FastMM4 in 'fastmm\FastMM4.pas',
FastMM4Messages in 'fastmm\FastMM4Messages.pas',
variants,
usharedstructs in 'units\usharedstructs.pas',
Classes;
var
ps:TPluginStruct;
hwnd:cardinal;
Function Str(N:integer):String;
begin
Result:=VarToStr(N);
end;
procedure OnLoad; stdcall;
begin
hwnd:=AllocateHWnd(nil);
end;
procedure OnFree; stdcall;
begin
DeallocateHWnd(hwnd);
end;
function GetPluginInfo(const ver: cardinal): PChar; stdcall;
begin
Result:='My first function in dll';
end;
function SetStruct(const struct: PPluginStruct): Boolean; stdcall;
begin
ps:=struct^;
Result:=True;
end;
Procedure OnRefreshPrecompile; stdcall;
begin
ps.UserFuncs.Add('Function str(N:Integer):String');
end;
function OnCallMethod(const ConnectId, ScriptId: integer;
const MethodName: String; // имя функции в верхнем регистре
var Params, // параметры функции
FuncResult: Variant // результат функции
): Boolean; stdcall; // если вернёт True то дальнейшая
// обработка функции прекратиться
begin
Result := false;
if MethodName='str' then
begin
FuncResult:=str(params[0]);
Result:=True;
end;
end;
exports
GetPluginInfo,
SetStruct,
OnCallMethod,
OnRefreshPrecompile,
OnLoad,
OnFree;
begin
end.
__________________
---------------------------__--------__-----
---____- ___--____--- ___/'- /__ ___-(__)-____
--/-___-/-__-\/-__--\ /-__--'/--|-/--//---//--__--\
-/-/_/ -/-/_/--/-/_/--/-/_/--/|--|/--'//---//--/-/--/
-\___-/\____/\____/\____/-|____//__'//_'/-/__/
/_-__/
Последний раз редактировалось goodvin1709, 12.01.2012 в 03:15.
|