![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Работа с DLL... [D5, Win95/98, WinME]
Serd © (2002-02-14 08:29:00)Уважаемые мастера, плз. помогите, почему-то при завершении работы вылетает ошибка: "Программа выполнила недопустимую.....", а потом "Run time Error" :(...... Всё это стало появляться после того, как я добавил в программу DLL.
Вот текст в проекте:
implemination
{$R RES}
function KeyGen(Key:string):boolean;stdcall;external "SetUp.dll";
function Coding(Text:string):string;stdcall;external "SetUp.dll";
function Decoding(Text:string):string; stdcall; external "SetUp.dll";
....
А вот текст в DLL
library SetUp;
function KeyGen(Text:string):boolean;stdcall;
begin
Result:=.....
end;
function Decoding(Text:string):string;stdcall;
begin
Result:=.....
end;
function Coding(Text:string):string;stdcall;
begin
.....
Result:=....
end;
exports
KeyGen,
Decoding,
Coding;
begin
end.
ПЛЗ. ПОМОГИТЕ!!!!!
Alx2 (2002-02-14 10:14:00) [1]Дух святой, не иначе :))
Serd (2002-02-14 10:07:00) [2]Не знаю почему, но она заработала, я даже ничего не исправлял...
?8-(
Serd (2002-02-14 09:54:00) [3]А вот всё, что используеться в Проекте:
{$R .RES}
function KeyGen(Key:string):boolean;stdcall;external "SetUp.dll";
function Coding(Text:string):string;stdcall;external "SetUp.dll";
function Decoding(Text:string):string; stdcall; external "SetUp.dll";
......
function TForm1.Code(str:string):string;
begin
Result:=Coding(str);
end;
function TForm1.DeCode(str:string):string;
begin
Result:=DeCoding(str);
end;
function TForm1.Ident(Key:string):boolean;
begin
if KeyGen(key)=true then
begin
Form1.Caption:="&&&&&&&&&&&&&&&&&&&&&&&&&&";
N8.Enabled:=true;
N12.Enabled:=true;
N17.Enabled:=false;
Result:=true;
end
else
Result:=false;
end;
Serd (2002-02-14 09:54:00) [4]А вот всё, что используеться в Проекте:
{$R .RES}
function KeyGen(Key:string):boolean;stdcall;external "SetUp.dll";
function Coding(Text:string):string;stdcall;external "SetUp.dll";
function Decoding(Text:string):string;stdcall;external "SetUp.dll";
......
function TForm1.Code(str:string):string;
begin
Result:=Coding(str);
end;
function TForm1.DeCode(str:string):string;
begin
Result:=DeCoding(str);
end;
function TForm1.Ident(Key:string):boolean;
begin
if KeyGen(key)=true then
begin
Form1.Caption:="&&&&&&&&&&&&&&&&&&&&&&&&&&";
N8.Enabled:=true;
N12.Enabled:=true;
N17.Enabled:=false;
Result:=true;
end
else
Result:=false;
end;
Serd (2002-02-14 09:48:00) [5]Вот полный текст DLL,а текст Prject"a очень большой.
library SetUp;
uses sharemem;
const
MAX=120;
DeCode:array[1..MAX] of Char=
("
Serd (2002-02-14 09:47:00) [6]У меня в этих функциях только строки преобразуються, больше ничего..... Сам ничё понять не могу....:(
Alx2 (2002-02-14 09:37:00) [7]пока слишком мало информации о том, что у тебя происходит.
На всякий случай - описание sharemem:
Important note about DLL memory management: ShareMem must be the
first unit in your library"s USES clause AND your project"s (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters.
Serd (2002-02-14 09:31:00) [8]Теперь у меня в шесть раз больше ошибок......:(
Неизвестное исключение пишет.....
Serd (2002-02-14 09:27:00) [9]Спасибо.!!!
Alx2 (2002-02-14 09:07:00) [10]sharemem в uses есть?
Если нет, добавь на первое место в списке uses и в dll и в голову проекта.