先不用理EtyClass
//////////////// 创建TCtlVehicleInOut ///////////////////////////////
library CtlVehicleInOut;
{$R *.res}
function CtlVehicleInOutClass : TCtlVehicleInOutClass;
begin
result := TCtlVehicleInOut;
end;
exports
CtlVehicleInOutClass;
////////////////////////////// 定义接口ICtlVehicleInOut ////////////////////
unit ICtlVehicle;
interface
uses
classes,
IEtyVehicle;
type
ICtlVehicleInOut = class;
TCtlVehicleInOutClass = class of ICtlVehicleInOut;
ICtlVehicleInOut = class
protected
public
constructor Create;
virtual;
procedure test();
virtual;
abstract;
end;
implementation
{ ICtlVehicleInOut }
constructor ICtlVehicleInOut.Create;
begin
inherited;
end;
/////////////////////////////// 实现接口 uImpCtlVehicle ////////////
unit uImpCtlVehicle;
interface
uses
IEtyVehicle,
ICtlVehicle,
Classes,
SysUtils,
uDMC,
Dialogs;
type
TCtlVehicleInOut = class(ICtlVehicleInOut)
private
m_dm :TdmClient;
public
constructor Create;
override;
procedure test();
override;
end;
implementation
{ TCtlVehicleInOut }
constructor TCtlVehicleInOut.Create;
begin
inherited;
ShowMessage('TCtlVehicleInOut.Create');
m_dm.Create(nil);
if (m_dm = nil) then
ShowMessage('m_dm is null')
else
ShowMessage('m_dm is ok');
end;
procedure TCtlVehicleInOut.test();
var
strCard_No : string;
begin
ShowMessage('etyVehicleInOut.Card_No');
m_dm.conn.AppServer.LoadData(dmClient.cdsVehicle.ProviderName, 'Clients', '');
strCard_No := m_dm.cdsVehicleLAST_NAME.AsString;
ShowMessage(strCard_No);
end;
end.