com中有个接口:
 ISchemaClass = interface(IDispatch)
    ['{2B5D4DB7-4699-4ADB-8543-1A69EC59BFD5}']
    function create_schema: HResult; stdcall;
    function Set_AOwner(Param1: SYSINT): HResult; stdcall;
  end;
有个接口对象TSchema,
然后编写对象事件:function TSchema.Set_AOwner(Param1: SYSINT): HResult;
var p:^tcomponent;
begin
  p:=ptr(param1);
  AOwner:=p^;          //AOwner在前面已经声明过
   // Result := DefaultInterface.Set_AOwner;
end;function TSchema.create_schema: HResult;
var query1:tquery;
begin
query1.Create(AOwner);
query1.Close ;
query1.SQL.Clear;
query1.SQL.Add('create table SchemaTable1');
query1.SQL.Add('(TableName char(255),');
query1.SQL.Add(' DimKey char(255),');
query1.SQL.Add(' primary key (tableName,DimKey))');
query1.Prepare;
query1.ExecSQL ;
query1.Close;
query1.SQL.Clear;
query1.SQL.Add('create table SchemaTable1');
query1.SQL.Add('(TableName char(255),');
query1.SQL.Add(' DimObj char(255),');
query1.SQL.Add(' primary key (tableName,DimObj))');
query1.Prepare;
query1.ExecSQL ;
 // Result := DefaultInterface.create_schema;
end;我在form中添加一个button,事件是:procedure TForm1.Button1Click(Sender: TObject);
var crtschm:olevariant;
begin
  crtschm:=coschema.create;
  crtschm.AOwner:=integer(addr(self));
  crtschm.Creat_schema;
end;程序能够运行起来,但是一单击button1,就出错,提示为:
Project metadataproject.exe raised exception class EOleSysError with message 'Class not registered'.Process stopped.Use Step or Run to continue.我点击错误提示的ok后,在crtschm:=coschema.create;这一句出现蓝条,用鼠标指向这句,出现提示:coschema.create=inaccessible value;开始我以为是com没注册,然后进type library点了注册按钮,但再运行还是出现这个错误,请大虾帮帮忙啊~~~~~~~~~~谢谢了!