有没有办法呢,本系统是一个MIS类型系统。
8 个解决方案
#1
改成DLL文件以后会比较麻烦!
#2
有没有办法呢,请教高手
#3
可以分成几个dll的,
如果你的每个模块有个主窗体;
那你在针对每个模块因出一个dll;
在调用的时候将住程序句并船给每个dll;
就分割开了
如果你的每个模块有个主窗体;
那你在针对每个模块因出一个dll;
在调用的时候将住程序句并船给每个dll;
就分割开了
#4
有啊,你把相应的功能做在不同的DLL中就可以了,然后在需要的时候调用DLL就可以了
#5
你用的是Delhpi?那你改成几个BPL不就更容易!
#6
整个程序有一个主窗口,其它各部分都是通过该窗口上的菜单调用的打开各个窗口,如果要改,具体怎么操作呢,谢谢大家的回答!把打开一个窗口的操作做成一个函数,放在各个DLL中,传一个该窗口的类名进去,在DLL中打开该窗口吗?
#7
差不多
一个简单的例子:
*********************************************************************************
library Project1;
uses
SysUtils,
Classes,
Unit1 in 'Unit1.pas' {Form1};
{$R *.res}
exports
ShowDLLForm name'showdllform';
begin
end.
******************************************************************************
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
procedure showdllform;stdcall;export;
implementation
{$R *.dfm}
procedure showdllform;stdcall;export;
begin
try
form1:=TForm1.Create(application);
try
form1.ShowModal;
finally
form1.Free;
end;
except
showmessage('dll中创建窗体失败!');
end;
end;
end.
***************************************************************************
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm2 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
function showdllform:boolean;stdcall;external '//你的dll文件' name'showdllform';
implementation
{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
begin
if showdllform=truee then
showmessage('成功')
else
showmessage('失败');
end;
end.
一个简单的例子:
*********************************************************************************
library Project1;
uses
SysUtils,
Classes,
Unit1 in 'Unit1.pas' {Form1};
{$R *.res}
exports
ShowDLLForm name'showdllform';
begin
end.
******************************************************************************
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
procedure showdllform;stdcall;export;
implementation
{$R *.dfm}
procedure showdllform;stdcall;export;
begin
try
form1:=TForm1.Create(application);
try
form1.ShowModal;
finally
form1.Free;
end;
except
showmessage('dll中创建窗体失败!');
end;
end;
end.
***************************************************************************
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm2 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
function showdllform:boolean;stdcall;external '//你的dll文件' name'showdllform';
implementation
{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
begin
if showdllform=truee then
showmessage('成功')
else
showmessage('失败');
end;
end.
#8
上面的Unit1和Unit2 分别属于两个不同的项目(我懒得重建,所以直接写了代码。两名字都没改),属于静态调用
也可以动态调用,随便你了
也可以动态调用,随便你了
#1
改成DLL文件以后会比较麻烦!
#2
有没有办法呢,请教高手
#3
可以分成几个dll的,
如果你的每个模块有个主窗体;
那你在针对每个模块因出一个dll;
在调用的时候将住程序句并船给每个dll;
就分割开了
如果你的每个模块有个主窗体;
那你在针对每个模块因出一个dll;
在调用的时候将住程序句并船给每个dll;
就分割开了
#4
有啊,你把相应的功能做在不同的DLL中就可以了,然后在需要的时候调用DLL就可以了
#5
你用的是Delhpi?那你改成几个BPL不就更容易!
#6
整个程序有一个主窗口,其它各部分都是通过该窗口上的菜单调用的打开各个窗口,如果要改,具体怎么操作呢,谢谢大家的回答!把打开一个窗口的操作做成一个函数,放在各个DLL中,传一个该窗口的类名进去,在DLL中打开该窗口吗?
#7
差不多
一个简单的例子:
*********************************************************************************
library Project1;
uses
SysUtils,
Classes,
Unit1 in 'Unit1.pas' {Form1};
{$R *.res}
exports
ShowDLLForm name'showdllform';
begin
end.
******************************************************************************
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
procedure showdllform;stdcall;export;
implementation
{$R *.dfm}
procedure showdllform;stdcall;export;
begin
try
form1:=TForm1.Create(application);
try
form1.ShowModal;
finally
form1.Free;
end;
except
showmessage('dll中创建窗体失败!');
end;
end;
end.
***************************************************************************
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm2 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
function showdllform:boolean;stdcall;external '//你的dll文件' name'showdllform';
implementation
{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
begin
if showdllform=truee then
showmessage('成功')
else
showmessage('失败');
end;
end.
一个简单的例子:
*********************************************************************************
library Project1;
uses
SysUtils,
Classes,
Unit1 in 'Unit1.pas' {Form1};
{$R *.res}
exports
ShowDLLForm name'showdllform';
begin
end.
******************************************************************************
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
procedure showdllform;stdcall;export;
implementation
{$R *.dfm}
procedure showdllform;stdcall;export;
begin
try
form1:=TForm1.Create(application);
try
form1.ShowModal;
finally
form1.Free;
end;
except
showmessage('dll中创建窗体失败!');
end;
end;
end.
***************************************************************************
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm2 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
function showdllform:boolean;stdcall;external '//你的dll文件' name'showdllform';
implementation
{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
begin
if showdllform=truee then
showmessage('成功')
else
showmessage('失败');
end;
end.
#8
上面的Unit1和Unit2 分别属于两个不同的项目(我懒得重建,所以直接写了代码。两名字都没改),属于静态调用
也可以动态调用,随便你了
也可以动态调用,随便你了