在客户端注册TLB:
uses
ActiveX, SysUtils, COMObj;
procedure TfrmLogin.RegTypeLibrary( Const FileName: String );
var
wFileName: WideString;
do
cName: WideString;
TypeLib: ITypeLib;
begin
if not( FileExists( FileName ) ) then
ShowMessage( 'Type library not found' );
wFileName := FileName;
OleCheck( LoadTypeLib( PWideChar( wFileName ), TypeLib ) );
OleCheck( TypeLib.GetDocumentation( -1, nil, nil, nil, @DocName ) );
do
cName := ExtractFilePath(do
cName );
OleCheck( RegisterTypeLib( TypeLib, PWideChar( wFileName ), PWideChar(do
cName ) ) );
end;