X
xzsyz
Unregistered / Unconfirmed
GUEST, unregistred user!
我的dll在调用结束时出现指针错误代码如下
library syz;
uses
SysUtils,
Classes,
activex,
about in 'about.pas' {frmabout};
{$R *.RES}
exports
showabout index 1;
begin
coinitialize(nil);
end.
unit about;
interface
uses
sharemem,Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls;
type
Tfrmabout = class(TForm)
imgabt: TImage;
shpimg: TShape;
lab2: TLabel;
lab1: TLabel;
Panel1: TPanel;
lab3: TLabel;
lab4: TLabel;
lab6: TLabel;
lab8: TLabel;
btnok: TButton;
lab7: TLabel;
lab5: TLabel;
private
{ Private declarations }
public
{ Public declarations }
end;
procedure showabout(Ahandle:Thandle;caption,version,companychar)
stdcall;
implementation
{$R *.DFM}
procedure showabout(Ahandle:Thandle;caption,version,companychar)
stdcall;
var
frmAbout:Tfrmabout;
begin
application.Handle:=Ahandle;
frmAbout:=Tfrmabout.Create(nil);
frmAbout.caption:=strpas(caption);
frmAbout.lab1.Caption:=strpas(caption);
frmAbout.lab2.Caption:=strpas(version);
frmAbout.lab3.Caption:=strpas(company);
try
frmAbout.showmodal;
finally
frmAbout.free;
end;
end;
end.
dll是在d5下写的,调用是在d6下调用的,不知是不是这个原因
library syz;
uses
SysUtils,
Classes,
activex,
about in 'about.pas' {frmabout};
{$R *.RES}
exports
showabout index 1;
begin
coinitialize(nil);
end.
unit about;
interface
uses
sharemem,Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls;
type
Tfrmabout = class(TForm)
imgabt: TImage;
shpimg: TShape;
lab2: TLabel;
lab1: TLabel;
Panel1: TPanel;
lab3: TLabel;
lab4: TLabel;
lab6: TLabel;
lab8: TLabel;
btnok: TButton;
lab7: TLabel;
lab5: TLabel;
private
{ Private declarations }
public
{ Public declarations }
end;
procedure showabout(Ahandle:Thandle;caption,version,companychar)
stdcall;
implementation
{$R *.DFM}
procedure showabout(Ahandle:Thandle;caption,version,companychar)
stdcall;
var
frmAbout:Tfrmabout;
begin
application.Handle:=Ahandle;
frmAbout:=Tfrmabout.Create(nil);
frmAbout.caption:=strpas(caption);
frmAbout.lab1.Caption:=strpas(caption);
frmAbout.lab2.Caption:=strpas(version);
frmAbout.lab3.Caption:=strpas(company);
try
frmAbout.showmodal;
finally
frmAbout.free;
end;
end;
end.
dll是在d5下写的,调用是在d6下调用的,不知是不是这个原因