通过dll调用form下showmodule方法的疑惑 我将一个form封装在dll中,然后再通过程序调用这个dll中的form。但是showmodule过程后,form是弹出了,但是在windows的任务栏下又有了一个任务(让人感觉上像是),这个任务就是弹出的form,这是为什么,应该如何解决? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 dll也是可执行文件,被调用的时候,也会进入到系统内存中,这是我的理解 unit Main;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; Button2: TButton; Memo1: TMemo; procedure Button1Click(Sender: TObject); private h : THandle; public { Public declarations } end;var Form1: TForm1; procedure ss(app: TApplication; cscreen: TScreen);stdcall;external 'DelphiDll.dll' name 'ShowForm';implementation //procedure ss( a:PInteger );stdcall;external 'Project1.dll' name 'PassArray'{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);begin ss(Application, Screen);end;end.传个Applicaion和Screen参数过去就行了. DLL中的代码如下procedure ShowForm(app: TApplication; cscreen: TScreen);stdcall;var M : TForm1;begin Application := app; Screen := cscreen; M := TForm1.Create(Nil); M.ShowModal; M.Free; jjwwang(风归叶) 的方法,把Application传到dll里面 我也传过去了呀,TScreen没有传,我来试试! 哦,我没有加上这一句,5555 Application := app;还问一下,dll的form的button按钮下的脚本Self.close;为什么就把我怎个程序关闭了呢? 经过测试,dll中的form是关闭了,但是我运行的程序还在内存中驻留了。能告诉我这是为什么呢? var oldapp :TApplication; oldscreen : TScreen;procedure ShowForm(app: TApplication; cscreen: TScreen);stdcall;var M : TForm1;begin oldapp := Application; oldscreen := Screen; Application := app; Screen := cscreen; M := TForm1.Create(Nil); M.ShowModal; M.Free; Application := oldapp; Screen := oldscreen;end;exportsShowForm; Application := oldapp; Screen := oldscreen;还需要还原回去. delphi中打开窗体是提示缺少控件但是为什么最后编译的时候项目能通过编译 我的程序为什么不能运行,看不到啊, (重分)寻求一个管理计算机硬件配置,已经装载的软件情况的软件。 dbgrid显示记录 高手請進,郁悶! 请大家帮忙,很急想解决它,thanks!!! delphi 报表的问题(使用qr) 售票软件 Listview通过消息控制ITEM求助 在dll开发中加入ado控件,调试时出现“没有调用 CoInitialize”错误,20分求救,急!! 关于delphi6编译的问题 我想用女声朗读,请教额头用delphi是怎么实现的?多谢了
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
h : THandle;
public
{ Public declarations }
end;var
Form1: TForm1;
procedure ss(app: TApplication; cscreen: TScreen);stdcall;external 'DelphiDll.dll' name 'ShowForm';
implementation
//procedure ss( a:PInteger );stdcall;external 'Project1.dll' name 'PassArray'
{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
begin
ss(Application, Screen);
end;end.
传个Applicaion和Screen参数过去就行了.
var
M : TForm1;
begin
Application := app;
Screen := cscreen;
M := TForm1.Create(Nil);
M.ShowModal;
M.Free;
还问一下,dll的form的button按钮下的脚本Self.close;为什么就把我怎个程序关闭了呢?
oldapp :TApplication;
oldscreen : TScreen;
procedure ShowForm(app: TApplication; cscreen: TScreen);stdcall;
var
M : TForm1;
begin
oldapp := Application;
oldscreen := Screen;
Application := app;
Screen := cscreen;
M := TForm1.Create(Nil);
M.ShowModal;
M.Free;
Application := oldapp;
Screen := oldscreen;
end;
exports
ShowForm;
Screen := oldscreen;
还需要还原回去.