![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
ЧТо-то не то... DLL
Wishmaster © (2005-11-14 22:08:00)сам удивляюсь, что не могу обнаружить ошибку, но перепробовал почти все.
unit Functiondll;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
function Summ(X,Y:Integer):Integer;StdCAll;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
function Summ; {ВОТ ЗДЕСЬ ОН ПИШЕТ ОШИБКУ FUNCTION NEEDS RESULT TYPE} external 'FirstDllProject.dll' name 'Summ';
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
r:Integer;
begin
r:=Summ(10,34);
Application.MessageBox(PChar(InToStr(r)),'????????? ??????? Summ');
end;
end.
Wishmaster (2005-11-15 11:07:00) [1]приму к сведению...
Leonid Troyanovsky (2005-11-15 09:07:00) [2]
> Wishmaster (15.11.05 08:53) [3]
> Такая глупая ошибка...
Это вторая ошибка.
Первая - в решении вынести функцию в dll.
--
Regards, LVT.
Wishmaster (2005-11-15 08:53:00) [3]gdaujk
А-агромное спасибо. все ок.
Такая глупая ошибка...
gdaujk (2005-11-15 08:05:00) [4]Wishmaster (14.11.05 22:08)
Наверное вынеси Summ из секции описания класса формы:
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
function Summ(X,Y:Integer):Integer;StdCAll;
implementation
function Summ; {ВОТ ЗДЕСЬ МОЖЕТ НЕ БУДУТ ПИСАТЬ ОШИБКУ :-)} external 'FirstDllProject.dll' name 'Summ';
DrPass (2005-11-14 22:48:00) [5]function Summ: integer ?