我想将一个mdi子窗体封入DLL然后在mdi主窗体中调用!!
dll side:
exports showform;
..........
procedure showform(a:thandle);stdcall;
.................
procedure showform(a:thandle)
var form1:tform1;
begin
application.handle:=a;
form1:=tform1.create(application);
form1.showmodal;
end; main process side:
type bb=procedure(a:thandle);
procedure onbuttonclick(sender;tobject)
var
ins:thandle;
dllin:bb;
begin
ins:=loadlibary('d:\mydll.dll');
@dllin:=getprocaddress(ins,'showform');
dllin(application.handle);
freelibray(ins);
end;
提示:access the involide address;....
dll side:
exports showform;
..........
procedure showform(a:thandle);stdcall;
.................
procedure showform(a:thandle)
var form1:tform1;
begin
application.handle:=a;
form1:=tform1.create(application);
form1.showmodal;
end; main process side:
type bb=procedure(a:thandle);
procedure onbuttonclick(sender;tobject)
var
ins:thandle;
dllin:bb;
begin
ins:=loadlibary('d:\mydll.dll');
@dllin:=getprocaddress(ins,'showform');
dllin(application.handle);
freelibray(ins);
end;
提示:access the involide address;....
解决方案 »
- 同名控件派生的问题
- DBGrid的一个简单问题
- 人事考勤系统中的夜班处理
- 怎样把两表(table)的内容在同一个dbgrid里面显示出来
- 有一条记录时不会出错,当有二条以上时有会出错
- 远程操作数据库,偶尔提示‘某某’字段无法找到!
- 线程间同步有哪些方法?各有什么特点??
- 大家轻松一下,一个最强帖子
- 求助,help,关于delphi开发asp组件的问题
- 非常简单的问题,在 fctreeview 中判断是否有父节点,必给分!
- 怎样让Treeview的所有项(包括所有子项)在程序启动就完全展开?
- 散分!散分!散分!http://www.csdn.net/expert/topic/1093/1093157.xml?temp=.141308
Function showform(app:TApplication): TForm; stdcall;
var form1:tform1;
begin
application:=app;
form1:=tform1.create(Application.MainForm);
Result:=form1;
end; //main process side
procedure onbuttonclick(sender;tobject)
var
ins:thandle;
dllin:bb;
frm: TForm;
begin
ins:=loadlibary('d:\mydll.dll');
@dllin:=getprocaddress(ins,'showform');
frm:=dllin(application);
frm.ParentWindow:=frmMain.Handle;
frm.FormStyle:=fsMDIChild;
frm.show;
end;