1:在关闭主程序报错: project d:\procedure\erp\vertex_erp.exe raised too many consecutive exeptions:'access violation at 0x005a3442:read of address 0x0125541c',process stopped,use step or run to continue.
2:DLL中有两个窗体,如何显示它的子窗体.
主程序:(有很多了窗体,这个只是其中的一个.)
unit Unit6;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons;type
TFrame6 = class(TFrame)
Label2: TLabel;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
BitBtn4: TBitBtn;
BitBtn5: TBitBtn;
BitBtn6: TBitBtn;
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;implementationuses Unit1;{$R *.dfm}
const
gdi32='sg_dgd_tj.dll';
function createform(capt:string):string;stdcall;external gdi32 name 'sg_dgd_tj';procedure TFrame6.BitBtn1Click(Sender: TObject);
var m:string;
begin
form1.windowstate:=wsminimized;
m:='订购单_添加';
createform(m); //这个地方是不是可以用其它方法调用呀.end;end.
DLL程序代码:(太多了,我只COPY了DLL声明的部份)
procedure cxTextEdit7KeyPress(Sender: TObject; var Key: Char);
procedure cxComboBox1Click(Sender: TObject);
procedure cxComboBox1Exit(Sender: TObject);
procedure FormClick(Sender: TObject);
private
aaa_1,aa_2,aa_3,aa_4,aa_5,aa_6:string;
{ Private declarations }
public
{ Public declarations }
end;
function createform(capt:string):string;stdcall;var
form1: Tform1;
implementationuses Unit2, SGDGD_TJDY;{$R *.dfm}
function createform(capt:string):string;stdcall;
var form1:tform1;
begin
form1:=tform1.Create(application);
form1.Show;
form1.Caption:=capt;
end;DLL:
library sg_dgd_tj;
uses
sgdgd_tj in 'sgdgd_tj.pas' {form1},
SGDGD_TJDY in 'SGDGD_TJDY.pas' {Form12};//就是这个窗体不知如何在被调用时显示出来.
exports
createform name 'sg_dgd_tj';
{$R *.res}begin
end.
2:DLL中有两个窗体,如何显示它的子窗体.
主程序:(有很多了窗体,这个只是其中的一个.)
unit Unit6;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons;type
TFrame6 = class(TFrame)
Label2: TLabel;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
BitBtn4: TBitBtn;
BitBtn5: TBitBtn;
BitBtn6: TBitBtn;
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;implementationuses Unit1;{$R *.dfm}
const
gdi32='sg_dgd_tj.dll';
function createform(capt:string):string;stdcall;external gdi32 name 'sg_dgd_tj';procedure TFrame6.BitBtn1Click(Sender: TObject);
var m:string;
begin
form1.windowstate:=wsminimized;
m:='订购单_添加';
createform(m); //这个地方是不是可以用其它方法调用呀.end;end.
DLL程序代码:(太多了,我只COPY了DLL声明的部份)
procedure cxTextEdit7KeyPress(Sender: TObject; var Key: Char);
procedure cxComboBox1Click(Sender: TObject);
procedure cxComboBox1Exit(Sender: TObject);
procedure FormClick(Sender: TObject);
private
aaa_1,aa_2,aa_3,aa_4,aa_5,aa_6:string;
{ Private declarations }
public
{ Public declarations }
end;
function createform(capt:string):string;stdcall;var
form1: Tform1;
implementationuses Unit2, SGDGD_TJDY;{$R *.dfm}
function createform(capt:string):string;stdcall;
var form1:tform1;
begin
form1:=tform1.Create(application);
form1.Show;
form1.Caption:=capt;
end;DLL:
library sg_dgd_tj;
uses
sgdgd_tj in 'sgdgd_tj.pas' {form1},
SGDGD_TJDY in 'SGDGD_TJDY.pas' {Form12};//就是这个窗体不知如何在被调用时显示出来.
exports
createform name 'sg_dgd_tj';
{$R *.res}begin
end.
在这里可以找找http://japee.com.cn/jew/bbs.aspx