我在编DLL时,进行编译时出错(50分)

  • 主题发起人 主题发起人 丛艳全
  • 开始时间 开始时间

丛艳全

Unregistered / Unconfirmed
GUEST, unregistred user!
cannot debug project unless a host application is defined .use the Run|paramters...dialog box.

这是一个问题
还有一个是:Format '%1' invalid or incompatible with argument
我的程序是:
library Project1;

uses
SysUtils,
Classes,
Unit1 in 'Unit1.pas' {Form1},
Unit2 in 'Unit2.pas' {Form2};

{$R *.res}
function diaoyong(Sender: TObject):Integer;
begin
form1.Show;
end;
begin
end.
请问这是哪的错!
这是我第一次做DLL啊
请多帮帮忙!!!
 
dll是非直接执行程序,你想运行他调试,必须为他找到一个调用它的程序,这个dll才会被加载启动。
写一个调用它的程序,然后在 run - paramters -host application 中指向这个exe .就可以调试dll了。

基本概念问题。
 
你没有声时你dll所输入的函数名;还有在你的函数后面加上stdcall;
 
library Project1;

uses
SysUtils,
Classes,
Unit1 in 'Unit1.pas' {Form1},
Unit2 in 'Unit2.pas' {Form2};

{$R *.res}
function diaoyong(Sender: TObject):Integer; stdcall;
begin
if not Assigned(form1) then
form1:=Tform1.Create(nil);
form1.Showmodal;
form1.free;
result:=1;//你写的是函数,也不写返回值;干什么? 要不就写成过程!
end;

exports
diaoyong;

end.
 
多人接受答案了。
 

Similar threads

I
回复
0
查看
975
import
I
I
回复
0
查看
834
import
I
I
回复
0
查看
823
import
I
I
回复
0
查看
855
import
I
后退
顶部