有如下xxxx.pas部分:Unit xxxx;interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;type
TMapiErrEvent = procedure(Sender: TObject; ErrCode: Integer) of object; TMapiControl = class(TComponent)
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
private
{ Private-Deklarationen }
FSubject: string;
FMailtext: string;
FFromName: string;
FFromAdress: string;
FTOAdr: TStrings;
FCCAdr: TStrings;
FBCCAdr: TStrings;
FAttachedFileName: TStrings;
FDisplayFileName: TStrings;
FShowDialog: Boolean;
FUseAppHandle: Boolean;
{ Error Events: }
FOnUserAbort: TNotifyEvent;
FOnMapiError: TMapiErrEvent;
FOnSuccess: TNotifyEvent; procedure SetToAddr(newValue: TStrings);
procedure SetCCAddr(newValue: TStrings);
procedure SetBCCAddr(newValue: TStrings);
procedure SetAttachedFileName(newValue: TStrings);
protected
{ Protected-Deklarationen }
public
{ Public-Deklarationen }
ApplicationHandle: THandle;
procedure Sendmail();
procedure Reset();
published
{ Published-Deklarationen }
property Subject: string read FSubject write FSubject;
property Body: string read FMailText write FMailText;
property FromName: string read FFromName write FFromName;
property FromAdress: string read FFromAdress write FFromAdress;
property Recipients: TStrings read FTOAdr write SetTOAddr;
property CopyTo: TStrings read FCCAdr write SetCCAddr;
property BlindCopyTo: TStrings read FBCCAdr write SetBCCAddr;
property AttachedFiles: TStrings read FAttachedFileName write SetAttachedFileName;
property DisplayFileName: TStrings read FDisplayFileName;
property ShowDialog: Boolean read FShowDialog write FShowDialog;
property UseAppHandle: Boolean read FUseAppHandle write FUseAppHandle; { Events: }
property OnUserAbort: TNotifyEvent read FOnUserAbort write FOnUserAbort;
property OnMapiError: TMapiErrEvent read FOnMapiError write FOnMapiError;
property OnSuccess: TNotifyEvent read FOnSuccess write FOnSuccess;
end;procedure Register;implementationuses Mapi;{ Register the component: }procedure Register;
begin
RegisterComponents('expectIT', [TMapiControl]);
end;{ TMapiControl }constructor TMapiControl.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FOnUserAbort := nil;
FOnMapiError := nil;
FOnSuccess := nil;
.........
怎样封装到DLL中,如何使用dll?????
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;type
TMapiErrEvent = procedure(Sender: TObject; ErrCode: Integer) of object; TMapiControl = class(TComponent)
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
private
{ Private-Deklarationen }
FSubject: string;
FMailtext: string;
FFromName: string;
FFromAdress: string;
FTOAdr: TStrings;
FCCAdr: TStrings;
FBCCAdr: TStrings;
FAttachedFileName: TStrings;
FDisplayFileName: TStrings;
FShowDialog: Boolean;
FUseAppHandle: Boolean;
{ Error Events: }
FOnUserAbort: TNotifyEvent;
FOnMapiError: TMapiErrEvent;
FOnSuccess: TNotifyEvent; procedure SetToAddr(newValue: TStrings);
procedure SetCCAddr(newValue: TStrings);
procedure SetBCCAddr(newValue: TStrings);
procedure SetAttachedFileName(newValue: TStrings);
protected
{ Protected-Deklarationen }
public
{ Public-Deklarationen }
ApplicationHandle: THandle;
procedure Sendmail();
procedure Reset();
published
{ Published-Deklarationen }
property Subject: string read FSubject write FSubject;
property Body: string read FMailText write FMailText;
property FromName: string read FFromName write FFromName;
property FromAdress: string read FFromAdress write FFromAdress;
property Recipients: TStrings read FTOAdr write SetTOAddr;
property CopyTo: TStrings read FCCAdr write SetCCAddr;
property BlindCopyTo: TStrings read FBCCAdr write SetBCCAddr;
property AttachedFiles: TStrings read FAttachedFileName write SetAttachedFileName;
property DisplayFileName: TStrings read FDisplayFileName;
property ShowDialog: Boolean read FShowDialog write FShowDialog;
property UseAppHandle: Boolean read FUseAppHandle write FUseAppHandle; { Events: }
property OnUserAbort: TNotifyEvent read FOnUserAbort write FOnUserAbort;
property OnMapiError: TMapiErrEvent read FOnMapiError write FOnMapiError;
property OnSuccess: TNotifyEvent read FOnSuccess write FOnSuccess;
end;procedure Register;implementationuses Mapi;{ Register the component: }procedure Register;
begin
RegisterComponents('expectIT', [TMapiControl]);
end;{ TMapiControl }constructor TMapiControl.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FOnUserAbort := nil;
FOnMapiError := nil;
FOnSuccess := nil;
.........
怎样封装到DLL中,如何使用dll?????
解决方案 »
- 怎样不用等待showmodal关闭就直接执行showmodal后的代码
- 菜鸟问题!!!!!!!
- 數據导出excel時 如何显示全数字字符串前面的零?
- 关于MaskEdit
- MSFlexGrid不能在delphi下使用??
- 如何计算字符型表达式如:12+3*5/10的值,返回数值型结果13。5
- 招聘Delphi程序员(人才难求啊,请大家见谅)
- dbgrid点击后怎样选中一行,而不是一个单元格?
- 导出WORD报错
- 我想知道那里有这些控件下载?
- 向oracle 权限管理比较熟的同志求救
- 我想用delphi调用一个用VC编写的DLL,并且得到其发出的消息数据(消息数据结构已知),不知是否可行???给分!!!
写为DLL,也很容易的么!