我如何把一form变成一个DLL 先新建一个Dll的项目,然后把你的窗体单元加进来,把调用窗体的函数输出即可。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 D5DG的例子:DLLFrm.pas{Copyright ?1999 by Delphi 5 Developer's Guide - Xavier Pacheco and Steve Teixeira}unit DLLFrm;interfaceuses SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls, Forms, Dialogs, Grids, Calendar;type TDLLForm = class(TForm) calDllCalendar: TCalendar; procedure calDllCalendarDblClick(Sender: TObject); end;{ Declare the export function }function ShowCalendar(AHandle: THandle; ACaption: String): TDateTime; StdCall;implementation{$R *.DFM}function ShowCalendar(AHandle: THandle; ACaption: String): TDateTime;var DLLForm: TDllForm;begin // Copy application handle to DLL's TApplication object Application.Handle := AHandle; DLLForm := TDLLForm.Create(Application); try DLLForm.Caption := ACaption; DLLForm.ShowModal; Result := DLLForm.calDLLCalendar.CalendarDate; // Pass the date back in Result finally DLLForm.Free; end;end;procedure TDLLForm.calDllCalendarDblClick(Sender: TObject);begin Close;end;end.CalendarLib.dprlibrary CalendarLib;uses ShareMem, SysUtils, Classes, DLLFrm in 'DLLFrm.pas' {DLLForm};exports ShowCalendar; beginend. Delphi 的热键应用 求图片显示的源码 如何在程序运行期用鼠标拖动控件并能改变其大小 欢迎加群(2006年6月新建),加满为止! webbrowser无法POST? 一个简单问题,马上结贴!!! 在线等--如何在Delphi里建立DLL动态链接库?请给些建议,或是链接,多谢! 在线等侯!!如何在程序中控制Grid的Options中的dgEditing属性??用亚来控制是否可以编辑 使用视图能否加快数据库的访问? 在csdn中从来没有人解决这个问题。。。。。。。 C/s与三层结构到底有什么区别? 快来看
DLLFrm.pas
{
Copyright ?1999 by Delphi 5 Developer's Guide - Xavier Pacheco and Steve Teixeira
}unit DLLFrm;interfaceuses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, Grids, Calendar;type TDLLForm = class(TForm)
calDllCalendar: TCalendar;
procedure calDllCalendarDblClick(Sender: TObject);
end;{ Declare the export function }
function ShowCalendar(AHandle: THandle; ACaption: String): TDateTime; StdCall;implementation
{$R *.DFM}function ShowCalendar(AHandle: THandle; ACaption: String): TDateTime;
var
DLLForm: TDllForm;
begin
// Copy application handle to DLL's TApplication object
Application.Handle := AHandle;
DLLForm := TDLLForm.Create(Application);
try
DLLForm.Caption := ACaption;
DLLForm.ShowModal;
Result := DLLForm.calDLLCalendar.CalendarDate; // Pass the date back in Result
finally
DLLForm.Free;
end;
end;procedure TDLLForm.calDllCalendarDblClick(Sender: TObject);
begin
Close;
end;end.CalendarLib.dprlibrary CalendarLib;uses
ShareMem,
SysUtils,
Classes,
DLLFrm in 'DLLFrm.pas' {DLLForm};exports
ShowCalendar;
begin
end.