mdserviceimpl.pas
来自「Delphi开发webservice的一套例子」· PAS 代码 · 共 56 行
PAS
56 行
{ Invokable implementation declaration unit for TmdService,
which implements ImdService }
unit mdServiceImpl;
interface
uses
mdServiceIntf, InvokeRegistry;
type
TmdService = class(TInterfacedObject, ImdService)
// Make sure you have your invokable logic implemented in ImdService
// first, then use CodeInsight(tm) to fill in this implementation
// section by pressing Ctrl+Space, marking all the interface
// declarations for ImdService, and pressing Enter.
// Once the declarations are inserted here, use ClassCompletion(tm)
// to write the implementation stubs by pressing Ctrl+Shift+C
public
function QueryMyData(const sSQLCommand : String; var vData : String) : Integer; stdcall;
function UpdateMyData(vData : String; var lErrorCount : Longint) : Integer; stdcall;
end;
implementation
uses ComObj;
procedure mdServiceFactory(out Obj: TObject);
begin
Obj := TmdService.Create;
end;
{ TmdService }
function TmdService.QueryMyData(const sSQLCommand: String;
var vData: String): Integer;
var
vObj : Variant;
begin
vObj := CreateOleObject('PDelphi6ADOServer.Delphi6ADOServer');
vObj.QueryMyData('Select * from employee', vData);
Result := S_OK;
end;
function TmdService.UpdateMyData(vData: String;
var lErrorCount: Integer): Integer;
begin
Result := S_OK;
end;
initialization
InvRegistry.RegisterInvokableClass(TmdService, @mdServiceFactory);
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?