����������� �� ��������� DLL ��� mIRC � Delphi. ����� 1.
��������: ������ ���������� ��� � ����� ��������� ���������� DLL ��� mIRC, ���������� � ����������� ��������, ������������ ����������.
------------------------------------------------------------------------------------------------

����������� �� ��������� DLL ��� mIRC � Delphi.
����� 1.

��� ��� ���� ������������� � ���������� �� mIRC 6.21 � Delphi 7.

� ��������� �������� ���� ���������� � ���, ��� ������� ������ DLL ��� mIRC. ���� �� �������� ������ � �� ����� ������������ DLL ���� ������� ��������.

����, ������.
DLL (Dynamic Link Libraries) � ��� ���� �� ����� ������� � ������� �������� ��������� � ����� ���������� �� ������ ���������� ��� ����, � �������� mIRC �� ������������.
������ �� ��� ����� ������ ������� ����������� DLL, ��� � �������� ������, �� ������ �� ��� ����������� ��������� �� ��� ����. DLL ��������� �� ������� � ������������������ �� ������������. ��� �������� � ���� ����� �������� � ������� ��� ������������� � ������ ����������. ��� ����� �� ��� ��� ����������� � mIRC? �� ������, ���� �� ������ ������ ������ ���������� ������ ����� ������������ �������, ����������� ���������� ������� ��������� ���������� ��� �� �� ����� ����������� �� ������� ������� ���� Winamp.
������ �������������, ��� �� ������ ������� ������ ������ � ����������� ������ Delphi, � ����� �� ������, �� ����� ������ �� Delphi 7, �������� ���������� � ������������� ������ ������ ������.

����, � Delphi, �������� ���� File � �������� New. �� ������ �������� DLL, ���� � ��� ��� ������ ������, �������� Other � ��� ��� ���� DLL. � ����� �� ������� ���-�� �����:
library Project1;

uses
SysUtils,
Classes;

{$R *.RES}

begin
end.

��� �������� ����� ������� � ���� Project ������� Options � �� �������� Directories and Conditionals ������� ���� �� ����� � mIRC. ������ ����� �������������� DLL, ��� �������� � ����� � mIRC.

����� ���� ������ �������, ������� ������ 'hello world'.
function helloworld(mWnd, aWnd: HWND; data, parms: PChar; show, nopause:boolean) :integer; stdcall;
begin
StrCopy(data,'Hello World!');
Result := 3;
End;

���� �� ��� �� ������, �� ��� ��������� � ������� � Delphi ������ ����������� ����� uses � begin. ����� �������� unit windows � ������ uses. �� ������:
uses
Windows, SysUtils, Classes;

����, ���������� �� ��������, ��� �������� ������ ���������� (����� �� ����� ������ � mIRC)

mWnd � ����� �������� ���� mIRC.
aWnd � ����� ���� � ������� ������ ���������� �������, ����� ���� � �� ������ �������� �����, ���� ������� ���������� ��������� ��������.
data � ����������, ������� �� ������� ������� DLL. DLL ����� ��������� ��� ���������� ��������, ������� mIRC ������ ����� ���������, ���� ������� �������.
parms � ���������� ����������� DLL ����� ���������� �����������, �������� mIRC ������ ����� ��������� ��� ���������� ������� �� ���������� data.
show � ���������� ����� ���� FALSE, ���� ������� . ��� ������ ��� ������� ���������� �������, � ��������� ������ TRUE.
nopause � ���������� ����� ���� TRUE, mIRC � ����������� ��� ���������� ��������� � DLL �� ������ ������ ������, ��� ����� ������� ����� � ��������, �������� DLL �� ������ ���� ��������� �������

���������� ���������� ������� ����� ���� ���������:
0 ��������, ��� mIRC ������ �������� ������� �������� /halt
1 ��������, ��� mIRC ������ ���������� �������
2 ��������, ��� DLL ��������� ���������� data ��������, ������� mIRC ������ ���������, � ��� ��������� ���������� parms ����������� ��� ���������� �������
3 ��������, ��� DLL ��������� ���������� data �����������, ������� ������������� $dll() ������ �������.

����� ������� StrCopy(data,'Hello World!'); ������ ��������� ������ Hello World � ���������� data. �� ������� ������ ��� data := 'Hello World';. ��������� 3 � ����� ����������, ��� ��� ������� ������������ ������������� $dll � mIRC ��� ��������� ������ �� ���������� data.

� ��� ������� �������� ��� ���� ���� � ��� ������ ����� ���������������, ��� ���������� ������ exports. ����� ����� ������� �������� ���:
Exports Helloworld;

��� �������� mIRC ����� ������ � ������� ������ ����� DLL ��� ��������� helloworld.

������, ��������� ���� Project � �������� ������� Build Project. ��� ���� DLL ������! ��������� mIRC � ����� //echo -a $dll(project1.dll,helloworld,NOT_USED). � ����� ������� Hello World! ��� �� ����� ������������� 3-�� ���������, ������ ��� �� �� �������� ������� ������ ����� DLL. ���� � ��� �������� ����� �� ������ ��� ����������, ���������� ��������� ������ ������ ��� ����������� �� ������.

����������, �� ������ ��� ������� ���� ������ DLL

������ �� �������� �������� ���:
library Project1;

uses
Windows, SysUtils, Classes;

function helloworld(mWnd, aWnd: HWND; data, parms: PChar; show, nopause:boolean):integer; stdcall;
begin
StrCopy(data,'Hello World!');
Result := 3;
End;

exports
helloworld;

{$R *.RES}

begin
end.

� ������ ������� ������� �������� ������ � ��������� ������������ ���������. �������� ����� ������� ��������� ���:

function helloworld(mWnd, aWnd: HWND; data, parms: PChar; show, nopause:boolean):integer; stdcall;
begin
StrCopy(data,'/echo -a Hello World!');
Result := 2;
End;

����������� ������ � �������� � mIRC ������� /dll project1.dll helloworld , ������� � ������ ��� Hello World! ��� ������, �� �������� result �� 2. ��� � ���������� mIRC ��������� ������� �� ���������� data, ������� ����� ��� /echo -a.

� ����� �� ���� ��� �������� ������ �������� ��������� �������� �������, � �� ��������� � ����� �������� ��������� � ��������� ������.

P.S. ��� ��������� ������ ���� ������������ ������� � ���������� � mircscripts.org
--------------------------------
������ �������: yXo
����� ��������!!!
�����! �������! 5 ������! �����, ���� ����!
������! �� ������ ���������! 4 �����
�������! ������ �����! �� 3 ����� �������.
�������������������! 2 �����
����� �����-��. �� ����� ����� ����� ����������� � ����?? 1 ����

������ � ������
����� ������ ��������� ���: 4447
����� ���������� ������: 71
������� ���� �� ������������: 3.8169014084507