Конференция "Corba" » Ошибка при подключении interface в Com объекте [Delphi, Windows]
 
  • umbra © (18.08.07 01:25) [40]
    без кода xxx_tlb.pas не разберешься. Недавно тут была подобная тема, когда ОЛЕ-сервер работал в C#, но не работал в делфи. такое впечатление, что в C# расширено множество OLE-совместимых типов. Весь код не надо, можно только обїявления типов.
  • systopler (18.08.07 07:06) [41]
    unit deObjDBLib_TLB;

    // ************************************************************************ //
    // WARNING                                                                    
    // -------                                                                    
    // The types declared in this file were generated from data read from a      
    // Type Library. If this type library is explicitly or indirectly (via        
    // another type library referring to this type library) re-imported, or the  
    // 'Refresh' command of the Type Library Editor activated while editing the  
    // Type Library, the contents of this file will be regenerated and all        
    // manual modifications will be lost.                                        
    // ************************************************************************ //

    // $Rev: 5081 $
    // File generated on 13.08.2007 19:43:14 from Type Library described below.

    // ************************************************************************  //
    // Type Lib: c:\Dgpp\bin\deObjDB.dll (1)
    // LIBID: {741B2D1D-A526-459B-8039-A9D5B4C42391}
    // LCID: 0
    // Helpfile:
    // HelpString: deObjDB 1.0 Type Library
    // DepndLst:
    //   (1) v2.0 stdole, (C:\WINDOWS\system32\stdole2.tlb)
    //   (2) v2.0 MSXML, (C:\WINDOWS\system32\msxml.dll)
    // Errors:
    //   Error creating palette bitmap of (TObjDB) : Server c:\Dgpp\bin\deObjDB.dll contains no icons
    //   Error creating palette bitmap of (TObjDBMetaObjectAdmin) : Server c:\Dgpp\bin\deObjDB.dll contains no icons
    // ************************************************************************ //
    // *************************************************************************//
    // NOTE:                                                                      
    // Items guarded by $IFDEF_LIVE_SERVER_AT_DESIGN_TIME are used by properties  
    // which return objects that may need to be explicitly created via a function
    // call prior to any access via the property. These items have been disabled  
    // in order to prevent accidental use from within the object inspector. You  
    // may enable them by defining LIVE_SERVER_AT_DESIGN_TIME or by selectively  
    // removing them from the $IFDEF blocks. However, such items must still be    
    // programmatically created via a method of the appropriate CoClass before    
    // they can be used.                                                          
    {$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
    {$WARN SYMBOL_PLATFORM OFF}
    {$WRITEABLECONST ON}
    {$VARPROPSETTER ON}
    interface

    uses Windows, ActiveX, Classes, Graphics, MSXML_TLB, OleServer, StdVCL, Variants;
     

    // *********************************************************************//
    // GUIDS declared in the TypeLibrary. Following prefixes are used:        
    //   Type Libraries     : LIBID_xxxx                                      
    //   CoClasses          : CLASS_xxxx                                      
    //   DISPInterfaces     : DIID_xxxx                                      
    //   Non-DISP interfaces: IID_xxxx                                        
    // *********************************************************************//
    const
     // TypeLibrary Major and minor versions
     deObjDBLibMajorVersion = 1;
     deObjDBLibMinorVersion = 0;

     LIBID_deObjDBLib: TGUID = '{741B2D1D-A526-459B-8039-A9D5B4C42391}';

     IID_IObjDB: TGUID = '{9B1611B2-F442-47B3-BE6E-463C82F28F6F}';
     IID_IObjDBConnection: TGUID = '{9445894E-48CD-4292-97A0-B3726BA9E688}';
     IID_IObjDBTransaction: TGUID = '{B03776A6-3972-4408-89BF-2F4B5257740C}';
     IID_IObjDBDataObject: TGUID = '{F88AC266-F91E-47CA-86FB-3656F96AAC9B}';
     IID_IObjDBMetaObject: TGUID = '{59C477FB-6E85-4648-B212-3F0D1BBE32CE}';
     IID_IObjDBMetaAttribute: TGUID = '{35DCF7E0-A0B4-456A-884A-7FCB9E3305BA}';
     IID_IObjDBMetaAttributeIterator: TGUID = '{3A9D19CE-6F64-4E81-B59A-7742A588BBCD}';
     IID_IObjDBDataObjectList: TGUID = '{57E22502-72D1-4738-A8ED-574D8AD3AD7F}';
     IID_IObjDBDataObjectIterator: TGUID = '{99A25EAB-2556-44A4-9EBA-7FFC041AE366}';
     IID_IObjDBQuery: TGUID = '{1C7C4E48-4C3A-42DC-86FF-EC9D5A0DFCDA}';
     IID_IObjDBQueryField: TGUID = '{4C8FEAAC-253F-4F37-9926-E78AB2A07B1B}';
     IID_IObjDBFieldIterator: TGUID = '{A7CA6C49-00D2-4080-BB9B-2BB13D346C4F}';
     IID_IObjDBSubQueryIterator: TGUID = '{2EBEA483-A63A-46D3-8EDA-425AF61A50AF}';
     IID_IObjDBMetadata: TGUID = '{462A1C44-F2C4-4B62-8BD6-04F8E63F5D58}';
     IID_IObjDBMetaObjectIterator: TGUID = '{4B74F07F-1CD1-46BC-B3FF-4CBCBA87EEF5}';
     IID_IObjDBAdminConnection: TGUID = '{FEF651F2-607B-452A-9FC1-6FBD06386DCF}';
     IID_IObjDBMetadataAdmin: TGUID = '{303D0C2D-ABB2-4E15-BFFD-E20AE1C88F8A}';
     IID_IObjDBMetaObjectAdmin: TGUID = '{09D9074A-A60C-43B1-B2BD-9F25E13CA86F}';
     IID_IObjDBMetaAttributeAdmin: TGUID = '{69246215-D6E4-4D7F-B684-CBA25E7770D0}';
     DIID__IObjDBEvents: TGUID = '{7EAED95B-D75C-4729-8929-FC2E84580C41}';
     CLASS_ObjDB: TGUID = '{98F6535A-79B2-409B-9068-07BB7E2EC61D}';
     IID_IObjDBImportTransaction: TGUID = '{AA3C2771-BD60-4637-918E-7B5F28959520}';
     IID_IObjDBRiskyTransaction: TGUID = '{F00DE4C4-B925-45B8-85C6-85DF768AD375}';
     DIID__IObjDBTransactionEvents: TGUID = '{A3E68AAC-C9CF-47F5-8A12-E336B92614F1}';
     DIID__IObjDBConnectionEvents: TGUID = '{F9719E3F-10D5-48C7-8A2D-E397C4D43842}';
     DIID__IObjDBAdminConnectionEvents: TGUID = '{47CB1F8C-6402-44FA-A22B-D79986B097ED}';
     IID_IObjDBConnectionLifeControl: TGUID = '{9680E259-BED2-4F6A-B5ED-53049FACB7F6}';
     CLASS_ObjDBMetaObjectAdmin: TGUID = '{6CCD0008-9654-4B38-AA9B-86274069A899}';
     IID_IObjDBQueryFieldInfo: TGUID = '{E693C032-A3E0-4394-95E7-845ABC8C9086}';
     IID_IObjDBQueryFieldTimestamp: TGUID = '{16034C62-09D1-4E7C-BF14-F587137F8F8C}';
     IID_IObjDBQueryFieldInteger: TGUID = '{FDB0244C-5B30-4C09-8F07-42A2845664B9}';
     IID_IObjDBQueryFieldDouble: TGUID = '{38B668A5-2AA6-4919-B894-34A0AF9B8EBB}';
     IID_IObjDBQueryFieldString: TGUID = '{9C7F8740-D53F-4239-93E3-1B2EE7DB5D07}';
     IID_IObjDBQueryFieldBLOB: TGUID = '{D9AF9358-753B-4E82-9699-B36DF7BF3D85}';
     IID_IObjDBQueryFieldGUID: TGUID = '{713DA60E-CA0C-4A6B-9A8A-48C6B7EB48F7}';
     IID_IObjDBQueryFieldBoolean: TGUID = '{9872B799-4D6B-4968-AA6E-CDCAAF1F5831}';
     IID_IObjDBQueryFieldShape: TGUID = '{470B575D-5355-4E10-B9EE-A5012C37EB2E}';

  • systopler (18.08.07 07:07) [42]
    // *********************************************************************//
    // Declaration of Enumerations defined in Type Library                    
    // *********************************************************************//
    // Constants for enum EODBTransactionType
    type
     EODBTransactionType = TOleEnum;
    const
     ODBTrReadReport = $00000000;
     ODBTrReadCommited = $00000001;
     ODBTrWriteMassUpdate = $00000002;
     ODBTrWriteSingleUpdate = $00000003;

    // Constants for enum EODBAttributeType
    type
     EODBAttributeType = TOleEnum;
    const
     ODBAttrTypeID = $00000001;
     ODBAttrTypeVersion = $00000002;
     ODBAttrTypeVersionList = $00000003;
     ODBAttrTypeParentID = $00000004;
     ODBAttrTypeUpdateTime = $00000005;
     ODBAttrTypeUpdateUser = $00000006;
     ODBAttrTypeVComments = $00000007;
     ODBAttrTypeName = $00000008;
     ODBAttrTypeInt = $00000064;
     ODBAttrTypeDouble = $00000065;
     ODBAttrTypeString = $00000066;
     ODBAttrTypeBLOB = $00000067;
     ODBAttrTypeGUID = $00000068;
     ODBAttrTypeBool = $00000069;
     ODBAttrTypeTimestamp = $0000006A;
     ODBAttrTypeShape = $0000006B;
     ODBAttrTypeDictRef = $000001F4;
     ODBAttrTypeSubObject = $000001F5;

    // Constants for enum EODBQueryVersionScope
    type
     EODBQueryVersionScope = TOleEnum;
    const
     ODBQVSActual = $00000000;
     ODBQVSAllVersions = $00000001;
     ODBQVSDeleted = $00000002;

    // Constants for enum EODBTransactionCloseReason
    type
     EODBTransactionCloseReason = TOleEnum;
    const
     ODBTrCloseByCommit = $00000000;
     ODBTrCloseByRollback = $00000001;
     ODBTrCloseByDisconnect = $00000002;

    type

    // *********************************************************************//
    // Forward declaration of types defined in TypeLibrary                    
    // *********************************************************************//
     IObjDB = interface;
     IObjDBConnection = interface;
     IObjDBTransaction = interface;
     IObjDBDataObject = interface;
     IObjDBMetaObject = interface;
     IObjDBMetaAttribute = interface;
     IObjDBMetaAttributeIterator = interface;
     IObjDBDataObjectList = interface;
     IObjDBDataObjectIterator = interface;
     IObjDBQuery = interface;
     IObjDBQueryField = interface;
     IObjDBFieldIterator = interface;
     IObjDBSubQueryIterator = interface;
     IObjDBMetadata = interface;
     IObjDBMetaObjectIterator = interface;
     IObjDBAdminConnection = interface;
     IObjDBMetadataAdmin = interface;
     IObjDBMetaObjectAdmin = interface;
     IObjDBMetaAttributeAdmin = interface;
     _IObjDBEvents = dispinterface;
     IObjDBImportTransaction = interface;
     IObjDBRiskyTransaction = interface;
     _IObjDBTransactionEvents = dispinterface;
     _IObjDBConnectionEvents = dispinterface;
     _IObjDBAdminConnectionEvents = dispinterface;
     IObjDBConnectionLifeControl = interface;
     IObjDBQueryFieldInfo = interface;
     IObjDBQueryFieldTimestamp = interface;
     IObjDBQueryFieldInteger = interface;
     IObjDBQueryFieldDouble = interface;
     IObjDBQueryFieldString = interface;
     IObjDBQueryFieldBLOB = interface;
     IObjDBQueryFieldGUID = interface;
     IObjDBQueryFieldBoolean = interface;
     IObjDBQueryFieldShape = interface;

  • systopler (18.08.07 07:08) [43]
    // *********************************************************************//
    // Declaration of CoClasses defined in Type Library                      
    // (NOTE: Here we map each CoClass to its Default Interface)              
    // *********************************************************************//
     ObjDB = IObjDB;
     ObjDBMetaObjectAdmin = IObjDBMetaObjectAdmin;

    // *********************************************************************//
    // Declaration of structures, unions and aliases.                        
    // *********************************************************************//
     PUserType1 = ^TGUID; {*}

    // *********************************************************************//
    // Interface: IObjDB
    // Flags:     (256) OleAutomation
    // GUID:      {9B1611B2-F442-47B3-BE6E-463C82F28F6F}
    // *********************************************************************//
     IObjDB = interface(IUnknown)
       ['{9B1611B2-F442-47B3-BE6E-463C82F28F6F}']
       function Connect(const pXMLConnection: IXMLDOMNode; const bstrUserLogin: WideString;
                        const bstrUserPassword: WideString; out ppNewConnection: IObjDBConnection): HResult; stdcall;
       function ConnectAdmin(const pXMLConnection: IXMLDOMNode; const bstrUserLogin: WideString;
                             const bstrUserPassword: WideString; const bstrDBALogin: WideString;
                             const bstrDBAPassword: WideString; bCreateBase: WordBool;
                             out ppNewConnection: IObjDBAdminConnection): HResult; stdcall;
     end;

    // *********************************************************************//
    // Interface: IObjDBConnection
    // Flags:     (256) OleAutomation
    // GUID:      {9445894E-48CD-4292-97A0-B3726BA9E688}
    // *********************************************************************//
     IObjDBConnection = interface(IUnknown)
       ['{9445894E-48CD-4292-97A0-B3726BA9E688}']
       function StartTransaction(eTrType: EODBTransactionType; out ppNewTransaction: IObjDBTransaction): HResult; stdcall;
       function Get_Metadata(out pVal: IObjDBMetadata): HResult; stdcall;
       function SetUpdateUserLogon(const bstrUserLogon: WideString): HResult; stdcall;
       function BackupDatabaseUser(const bstrBackupFile: WideString; const bstrDBALogin: WideString;
                                   const bstrDBAPassword: WideString): HResult; stdcall;
       function SuggestBackupFileName(out pVal: WideString): HResult; stdcall;
     end;

    // *********************************************************************//
    // Interface: IObjDBTransaction
    // Flags:     (256) OleAutomation
    // GUID:      {B03776A6-3972-4408-89BF-2F4B5257740C}
    // *********************************************************************//
     IObjDBTransaction = interface(IUnknown)
       ['{B03776A6-3972-4408-89BF-2F4B5257740C}']
       function Commit: HResult; stdcall;
       function Rollback: HResult; stdcall;
       function Insert(const pDataObject: IObjDBDataObject): HResult; stdcall;
       function Update(const pDataObject: IObjDBDataObject): HResult; stdcall;
       function Delete(const pDataObject: IObjDBDataObject): HResult; stdcall;
       function DeleteByID(const pMetaObject: IObjDBMetaObject; nDataObjectID: SYSINT): HResult; stdcall;
       function Retrieve(const pMetaObject: IObjDBMetaObject; nDataObjectID: SYSINT;
                         out ppDataObject: IObjDBDataObject): HResult; stdcall;
       function RetrieveVersion(const pMetaObject: IObjDBMetaObject; nDataObjectVersion: SYSINT;
                                out ppDataObject: IObjDBDataObject): HResult; stdcall;
       function ExecuteQuery(const pQuery: IObjDBQuery): HResult; stdcall;
       function SetLock(const pDataObject: IObjDBDataObject): HResult; stdcall;
       function CommitRetaining: HResult; stdcall;
       function GetServerTime(out pVal: TDateTime): HResult; stdcall;
       function StartNestedTransaction(out pVal: IObjDBTransaction): HResult; stdcall;
       function RestoreByID(const pMetaObject: IObjDBMetaObject; nDataObjectID: SYSINT): HResult; stdcall;
     end;

  • systopler (18.08.07 07:09) [44]
    // *********************************************************************//
    // Interface: IObjDBDataObject
    // Flags:     (256) OleAutomation
    // GUID:      {F88AC266-F91E-47CA-86FB-3656F96AAC9B}
    // *********************************************************************//
     IObjDBDataObject = interface(IUnknown)
       ['{F88AC266-F91E-47CA-86FB-3656F96AAC9B}']
       function GetMetaObject(out ppMetaObject: IObjDBMetaObject): HResult; stdcall;
       function GetID(out pVal: SYSINT): HResult; stdcall;
       function GetParentID(out pVal: SYSINT): HResult; stdcall;
       function GetVersion(out pVal: SYSINT): HResult; stdcall;
       function GetVComments(out pVal: WideString): HResult; stdcall;
       function GetUpdTime(out pVal: TDateTime): HResult; stdcall;
       function GetUpdUser(out pVal: WideString): HResult; stdcall;
       function GetName(out pVal: WideString): HResult; stdcall;
       function GetIntegerValue(const bstrAttrCode: WideString; out pVal: SYSINT): HResult; stdcall;
       function SetIntegerValue(const bstrAttrCode: WideString; nVal: SYSINT): HResult; stdcall;
       function GetDoubleValue(const bstrAttrCode: WideString; out pVal: Double): HResult; stdcall;
       function SetDoubleValue(const bstrAttrCode: WideString; dVal: Double): HResult; stdcall;
       function GetStringValue(const bstrAttrCode: WideString; out pVal: WideString): HResult; stdcall;
       function SetStringValue(const bstrAttrCode: WideString; const bstrVal: WideString): HResult; stdcall;
       function GetBLOBValue(const bstrAttrCode: WideString; out pVal: PSafeArray): HResult; stdcall;
       function SetBLOBValue(const bstrAttrCode: WideString; saVal: PSafeArray): HResult; stdcall;
       function GetBLOBValueVariant(const bstrAttrCode: WideString; out pVal: OleVariant): HResult; stdcall;
       function SetBLOBValueVariant(const bstrAttrCode: WideString; vVal: OleVariant): HResult; stdcall;
       function GetGUIDValue(const bstrAttrCode: WideString; out pVal: TGUID): HResult; stdcall;
       function SetGUIDValue(const bstrAttrCode: WideString; var guidVal: TGUID): HResult; stdcall;
       function GetGUIDValueText(const bstrAttrCode: WideString; out pVal: WideString): HResult; stdcall;
       function SetGUIDValueText(const bstrAttrCode: WideString; const bstrVal: WideString): HResult; stdcall;
       function GetBooleanValue(const bstrAttrCode: WideString; out pVal: WordBool): HResult; stdcall;
       function SetBooleanValue(const bstrAttrCode: WideString; bVal: WordBool): HResult; stdcall;
       function GetTimestampValue(const bstrAttrCode: WideString; out pVal: TDateTime): HResult; stdcall;
       function SetTimestampValue(const bstrAttrCode: WideString; tmVal: TDateTime): HResult; stdcall;
       function GetShapeValue(const bstrAttrCode: WideString; out pXMin: SYSINT; out pXMax: SYSINT;
                              out pYMin: SYSINT; out pYMax: SYSINT; out pVal: PSafeArray): HResult; stdcall;
       function SetShapeValue(const bstrAttrCode: WideString; nXMin: SYSINT; nXMax: SYSINT;
                              nYMin: SYSINT; nYMax: SYSINT; saVal: PSafeArray): HResult; stdcall;
       function GetShapeValueVariant(const bstrAttrCode: WideString; out pXMin: SYSINT;
                                     out pXMax: SYSINT; out pYMin: SYSINT; out pYMax: SYSINT;
                                     out pVal: OleVariant): HResult; stdcall;
       function SetShapeValueVariant(const bstrAttrCode: WideString; nXMin: SYSINT; nXMax: SYSINT;
                                     nYMin: SYSINT; nYMax: SYSINT; vVal: OleVariant): HResult; stdcall;
       function GetDictRefValue(const bstrAttrCode: WideString; out pVal: SYSINT): HResult; stdcall;
       function SetDictRefValue(const bstrAttrCode: WideString; nVal: SYSINT): HResult; stdcall;
       function GetSubObjValue(const bstrAttrCode: WideString; out pVal: IObjDBDataObjectList): HResult; stdcall;
       function IsNullValue(const bstrAttrCode: WideString; out pVal: WordBool): HResult; stdcall;
       function SetNullValue(const bstrAttrCode: WideString): HResult; stdcall;
       function GetMetaAttribute(const bstrAttrCode: WideString; out pVal: IObjDBMetaAttribute): HResult; stdcall;
       function Get_ReadOnly(out pVal: WordBool): HResult; stdcall;
     end;

    // *********************************************************************//
    // Interface: IObjDBMetaObject
    // Flags:     (256) OleAutomation
    // GUID:      {59C477FB-6E85-4648-B212-3F0D1BBE32CE}
    // *********************************************************************//
     IObjDBMetaObject = interface(IUnknown)
       ['{59C477FB-6E85-4648-B212-3F0D1BBE32CE}']
       function GetName(out pVal: WideString): HResult; stdcall;
       function GetCode(out pVal: WideString): HResult; stdcall;
       function IsRequired(out pVal: WordBool): HResult; stdcall;
       function IsVersioned(out pVal: WordBool): HResult; stdcall;
       function GetNameExpression(out pVal: WideString): HResult; stdcall;
       function GetAttribute(const bstrCode: WideString; out ppMetaAttribute: IObjDBMetaAttribute): HResult; stdcall;
       function GetAttributeIterator(out pVal: IObjDBMetaAttributeIterator): HResult; stdcall;
       function MakeEmptyDataObject(out ppDataObject: IObjDBDataObject): HResult; stdcall;
     end;

  • systopler (18.08.07 07:11) [45]
    // *********************************************************************//
    // Interface: IObjDBMetaAttribute
    // Flags:     (256) OleAutomation
    // GUID:      {35DCF7E0-A0B4-456A-884A-7FCB9E3305BA}
    // *********************************************************************//
     IObjDBMetaAttribute = interface(IUnknown)
       ['{35DCF7E0-A0B4-456A-884A-7FCB9E3305BA}']
       function GetName(out pVal: WideString): HResult; stdcall;
       function GetCode(out pVal: WideString): HResult; stdcall;
       function GetType(out pVal: EODBAttributeType): HResult; stdcall;
       function IsRequired(out pVal: WordBool): HResult; stdcall;
       function IsNullable(out pVal: WordBool): HResult; stdcall;
       function GetLength(out pVal: SYSINT): HResult; stdcall;
       function GetModuleParameters(out pVal: WideString): HResult; stdcall;
       function GetRefObject(out ppMetaObject: IObjDBMetaObject): HResult; stdcall;
       function IsIndexed(out pVal: WordBool): HResult; stdcall;
       function IsForeignKeyPresent(out pVal: WordBool): HResult; stdcall;
       function GetOwner(out pVal: IObjDBMetaObject): HResult; stdcall;
     end;

    // *********************************************************************//
    // Interface: IObjDBMetaAttributeIterator
    // Flags:     (256) OleAutomation
    // GUID:      {3A9D19CE-6F64-4E81-B59A-7742A588BBCD}
    // *********************************************************************//
     IObjDBMetaAttributeIterator = interface(IUnknown)
       ['{3A9D19CE-6F64-4E81-B59A-7742A588BBCD}']
       function GetNextAttribute(out ppMetaAttribute: IObjDBMetaAttribute): HResult; stdcall;
     end;

    // *********************************************************************//
    // Interface: IObjDBDataObjectList
    // Flags:     (256) OleAutomation
    // GUID:      {57E22502-72D1-4738-A8ED-574D8AD3AD7F}
    // *********************************************************************//
     IObjDBDataObjectList = interface(IUnknown)
       ['{57E22502-72D1-4738-A8ED-574D8AD3AD7F}']
       function GetDataObjectIterator(out pVal: IObjDBDataObjectIterator): HResult; stdcall;
       function AddNewDataObject(out ppDataObject: IObjDBDataObject): HResult; stdcall;
       function RemoveDataObject(const pDataObject: IObjDBDataObject): HResult; stdcall;
     end;

    // *********************************************************************//
    // Interface: IObjDBDataObjectIterator
    // Flags:     (256) OleAutomation
    // GUID:      {99A25EAB-2556-44A4-9EBA-7FFC041AE366}
    // *********************************************************************//
     IObjDBDataObjectIterator = interface(IUnknown)
       ['{99A25EAB-2556-44A4-9EBA-7FFC041AE366}']
       function GetNextDataObject(out ppDataObject: IObjDBDataObject): HResult; stdcall;
     end;

  • systopler (18.08.07 07:11) [46]
    // *********************************************************************//
    // Interface: IObjDBQuery
    // Flags:     (256) OleAutomation
    // GUID:      {1C7C4E48-4C3A-42DC-86FF-EC9D5A0DFCDA}
    // *********************************************************************//
     IObjDBQuery = interface(IUnknown)
       ['{1C7C4E48-4C3A-42DC-86FF-EC9D5A0DFCDA}']
       function Fetch(out pAvailable: WordBool): HResult; stdcall;
       function Close: HResult; stdcall;
       function GetField(const bstrFieldName: WideString; out ppField: IObjDBQueryField): HResult; stdcall;
       function GetSubQuery(const bstrFieldName: WideString; out ppSubQuery: IObjDBQuery): HResult; stdcall;
       function GetMetaObject(out ppMetaObject: IObjDBMetaObject): HResult; stdcall;
       function GetName(out pName: WideString): HResult; stdcall;
       function IsPartOfParentQuery(out pPart: WordBool): HResult; stdcall;
       function GetFieldIterator(out ppVal: IObjDBFieldIterator): HResult; stdcall;
       function GetSubQueryIterator(out ppVal: IObjDBSubQueryIterator): HResult; stdcall;
       function GetVersionScope(out pVal: EODBQueryVersionScope): HResult; stdcall;
       function GetPositionInParentQuery(out pVal: SYSINT): HResult; stdcall;
       function GetInnerQueryString(out pVal: WideString): HResult; stdcall;
       function GetFullName(out pFullName: WideString): HResult; stdcall;
       function GetParentQuery(out pVal: IObjDBQuery): HResult; stdcall;
     end;

    // *********************************************************************//
    // Interface: IObjDBQueryField
    // Flags:     (256) OleAutomation
    // GUID:      {4C8FEAAC-253F-4F37-9926-E78AB2A07B1B}
    // *********************************************************************//
     IObjDBQueryField = interface(IUnknown)
       ['{4C8FEAAC-253F-4F37-9926-E78AB2A07B1B}']
       function GetName(out pName: WideString): HResult; stdcall;
       function IsNullValue(out pVal: WordBool): HResult; stdcall;
       function GetMetaAttribute(out pVal: IObjDBMetaAttribute): HResult; stdcall;
       function GetPositionInQuery(out pVal: SYSINT): HResult; stdcall;
     end;

    // *********************************************************************//
    // Interface: IObjDBFieldIterator
    // Flags:     (256) OleAutomation
    // GUID:      {A7CA6C49-00D2-4080-BB9B-2BB13D346C4F}
    // *********************************************************************//
     IObjDBFieldIterator = interface(IUnknown)
       ['{A7CA6C49-00D2-4080-BB9B-2BB13D346C4F}']
       function GetNextField(out ppField: IObjDBQueryField): HResult; stdcall;
     end;

    // *********************************************************************//
    // Interface: IObjDBSubQueryIterator
    // Flags:     (256) OleAutomation
    // GUID:      {2EBEA483-A63A-46D3-8EDA-425AF61A50AF}
    // *********************************************************************//
     IObjDBSubQueryIterator = interface(IUnknown)
       ['{2EBEA483-A63A-46D3-8EDA-425AF61A50AF}']
       function GetNextSubQuery(out ppQuery: IObjDBQuery): HResult; stdcall;
     end;

    // *********************************************************************//
    // Interface: IObjDBMetadata
    // Flags:     (256) OleAutomation
    // GUID:      {462A1C44-F2C4-4B62-8BD6-04F8E63F5D58}
    // *********************************************************************//
     IObjDBMetadata = interface(IUnknown)
       ['{462A1C44-F2C4-4B62-8BD6-04F8E63F5D58}']
       function GetMetaObject(const bstrCode: WideString; out ppMetaObject: IObjDBMetaObject): HResult; stdcall;
       function GetMetaObjectIterator(out pVal: IObjDBMetaObjectIterator): HResult; stdcall;
       function PrepareQuery(const bstrQuery: WideString; out ppQueryObject: IObjDBQuery): HResult; stdcall;
     end;

  • systopler (18.08.07 07:12) [47]
    // *********************************************************************//
    // Interface: IObjDBMetaObjectIterator
    // Flags:     (256) OleAutomation
    // GUID:      {4B74F07F-1CD1-46BC-B3FF-4CBCBA87EEF5}
    // *********************************************************************//
     IObjDBMetaObjectIterator = interface(IUnknown)
       ['{4B74F07F-1CD1-46BC-B3FF-4CBCBA87EEF5}']
       function GetNextMetaObject(out ppMetaObject: IObjDBMetaObject): HResult; stdcall;
     end;

    // *********************************************************************//
    // Interface: IObjDBAdminConnection
    // Flags:     (256) OleAutomation
    // GUID:      {FEF651F2-607B-452A-9FC1-6FBD06386DCF}
    // *********************************************************************//
     IObjDBAdminConnection = interface(IObjDBConnection)
       ['{FEF651F2-607B-452A-9FC1-6FBD06386DCF}']
       function BackupDatabase(const bstrBackupFile: WideString): HResult; stdcall;
       function RestoreIndices: HResult; stdcall;
     end;

    // *********************************************************************//
    // Interface: IObjDBMetadataAdmin
    // Flags:     (256) OleAutomation
    // GUID:      {303D0C2D-ABB2-4E15-BFFD-E20AE1C88F8A}
    // *********************************************************************//
     IObjDBMetadataAdmin = interface(IObjDBMetadata)
       ['{303D0C2D-ABB2-4E15-BFFD-E20AE1C88F8A}']
       function AddMetaObject(const pMetaObject: IObjDBMetaObjectAdmin): HResult; stdcall;
       function RemoveMetaObject(const pMetaObject: IObjDBMetaObjectAdmin): HResult; stdcall;
       function ApplyObjectStructure(const pXMLObjStruct: IXMLDOMNode): HResult; stdcall;
     end;

    // *********************************************************************//
    // Interface: IObjDBMetaObjectAdmin
    // Flags:     (256) OleAutomation
    // GUID:      {09D9074A-A60C-43B1-B2BD-9F25E13CA86F}
    // *********************************************************************//
     IObjDBMetaObjectAdmin = interface(IObjDBMetaObject)
       ['{09D9074A-A60C-43B1-B2BD-9F25E13CA86F}']
       function SetName(const newVal: WideString): HResult; stdcall;
       function SetCode(const newVal: WideString): HResult; stdcall;
       function SetRequired(newVal: WordBool): HResult; stdcall;
       function SetVersioned(newVal: WordBool): HResult; stdcall;
       function SetNameExpression(const newVal: WideString): HResult; stdcall;
       function AddIntegerAttribute(const bstrCode: WideString; const bstrName: WideString;
                                    bIsRequired: WordBool; bIsNullable: WordBool;
                                    const bstrModPar: WideString;
                                    out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult; stdcall;
       function AddDoubleAttribute(const bstrCode: WideString; const bstrName: WideString;
                                   bIsRequired: WordBool; bIsNullable: WordBool;
                                   const bstrModPar: WideString;
                                   out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult; stdcall;
       function AddStringAttribute(const bstrCode: WideString; const bstrName: WideString;
                                   nLength: SYSINT; bIsRequired: WordBool;
                                   const bstrModPar: WideString;
                                   out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult; stdcall;
       function AddBLOBAttribute(const bstrCode: WideString; const bstrName: WideString;
                                 bIsRequired: WordBool; bIsNullable: WordBool; nLength: SYSINT;
                                 const bstrModPar: WideString;
                                 out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult; stdcall;
       function AddGUIDAttribute(const bstrCode: WideString; const bstrName: WideString;
                                 bIsRequired: WordBool; bIsNullable: WordBool;
                                 const bstrModPar: WideString;
                                 out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult; stdcall;
       function AddBooleanAttribute(const bstrCode: WideString; const bstrName: WideString;
                                    bIsRequired: WordBool; const bstrModPar: WideString;
                                    out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult; stdcall;
       function AddTimestampAttribute(const bstrCode: WideString; const bstrName: WideString;
                                      bIsRequired: WordBool; bIsNullable: WordBool;
                                      const bstrModPar: WideString;
                                      out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult; stdcall;
       function AddShapeAttribute(const bstrCode: WideString; const bstrName: WideString;
                                  bIsRequired: WordBool; nLength: SYSINT;
                                  const bstrModPar: WideString;
                                  out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult; stdcall;
       function AddDictRefAttribute(const bstrCode: WideString; const bstrName: WideString;
                                    bIsRequired: WordBool; bIsNullable: WordBool;
                                    const bstrModPar: WideString; const pRefObject: IObjDBMetaObject;
                                    out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult; stdcall;
       function AddSubObjectAttribute(const bstrCode: WideString; const bstrName: WideString;
                                      bIsRequired: WordBool; const bstrModPar: WideString;
                                      const pRefObject: IObjDBMetaObject;
                                      out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult; stdcall;
       function RemoveAttribute(const pMetaAttribute: IObjDBMetaAttributeAdmin): HResult; stdcall;
     end;

  • systopler (18.08.07 07:12) [48]
    // *********************************************************************//
    // Interface: IObjDBMetaAttributeAdmin
    // Flags:     (256) OleAutomation
    // GUID:      {69246215-D6E4-4D7F-B684-CBA25E7770D0}
    // *********************************************************************//
     IObjDBMetaAttributeAdmin = interface(IObjDBMetaAttribute)
       ['{69246215-D6E4-4D7F-B684-CBA25E7770D0}']
       function SetName(const newVal: WideString): HResult; stdcall;
       function SetRequired(newVal: WordBool): HResult; stdcall;
       function SetNullable(newVal: WordBool): HResult; stdcall;
       function SetLength(newVal: SYSINT): HResult; stdcall;
       function SetModuleParameters(const newVal: WideString): HResult; stdcall;
       function SetIndexed(newVal: WordBool): HResult; stdcall;
       function SetForeignKeyPresent(newVal: WordBool): HResult; stdcall;
     end;

    // *********************************************************************//
    // DispIntf:  _IObjDBEvents
    // Flags:     (4096) Dispatchable
    // GUID:      {7EAED95B-D75C-4729-8929-FC2E84580C41}
    // *********************************************************************//
     _IObjDBEvents = dispinterface
       ['{7EAED95B-D75C-4729-8929-FC2E84580C41}']
     end;

    // *********************************************************************//
    // Interface: IObjDBImportTransaction
    // Flags:     (256) OleAutomation
    // GUID:      {AA3C2771-BD60-4637-918E-7B5F28959520}
    // *********************************************************************//
     IObjDBImportTransaction = interface(IUnknown)
       ['{AA3C2771-BD60-4637-918E-7B5F28959520}']
       function Get_Generator(const pMetaObject: IObjDBMetaObject; out pVal: Integer): HResult; stdcall;
       function Set_Generator(const pMetaObject: IObjDBMetaObject; pVal: Integer): HResult; stdcall;
       function Insert(const pDataObject: IObjDBDataObject; nId: Integer; nVersion: Integer): HResult; stdcall;
     end;

    // *********************************************************************//
    // Interface: IObjDBRiskyTransaction
    // Flags:     (256) OleAutomation
    // GUID:      {F00DE4C4-B925-45B8-85C6-85DF768AD375}
    // *********************************************************************//
     IObjDBRiskyTransaction = interface(IUnknown)
       ['{F00DE4C4-B925-45B8-85C6-85DF768AD375}']
       function Insert(const pDataObject: IObjDBDataObject; nId: Integer): HResult; stdcall;
     end;

    // *********************************************************************//
    // DispIntf:  _IObjDBTransactionEvents
    // Flags:     (4096) Dispatchable
    // GUID:      {A3E68AAC-C9CF-47F5-8A12-E336B92614F1}
    // *********************************************************************//
     _IObjDBTransactionEvents = dispinterface
       ['{A3E68AAC-C9CF-47F5-8A12-E336B92614F1}']
       procedure TransactionClosed(eCloseReason: EODBTransactionCloseReason); dispid 1;
     end;

    // *********************************************************************//
    // DispIntf:  _IObjDBConnectionEvents
    // Flags:     (4096) Dispatchable
    // GUID:      {F9719E3F-10D5-48C7-8A2D-E397C4D43842}
    // *********************************************************************//
     _IObjDBConnectionEvents = dispinterface
       ['{F9719E3F-10D5-48C7-8A2D-E397C4D43842}']
     end;

    // *********************************************************************//
    // DispIntf:  _IObjDBAdminConnectionEvents
    // Flags:     (4096) Dispatchable
    // GUID:      {47CB1F8C-6402-44FA-A22B-D79986B097ED}
    // *********************************************************************//
     _IObjDBAdminConnectionEvents = dispinterface
       ['{47CB1F8C-6402-44FA-A22B-D79986B097ED}']
     end;

  • systopler (18.08.07 07:13) [49]
    // *********************************************************************//
    // Interface: IObjDBConnectionLifeControl
    // Flags:     (256) OleAutomation
    // GUID:      {9680E259-BED2-4F6A-B5ED-53049FACB7F6}
    // *********************************************************************//
     IObjDBConnectionLifeControl = interface(IUnknown)
       ['{9680E259-BED2-4F6A-B5ED-53049FACB7F6}']
       function CloseConnection: HResult; stdcall;
     end;

    // *********************************************************************//
    // Interface: IObjDBQueryFieldInfo
    // Flags:     (256) OleAutomation
    // GUID:      {E693C032-A3E0-4394-95E7-845ABC8C9086}
    // *********************************************************************//
     IObjDBQueryFieldInfo = interface(IUnknown)
       ['{E693C032-A3E0-4394-95E7-845ABC8C9086}']
       function GetName(out pName: WideString): HResult; stdcall;
       function GetMetaAttribute(out pVal: IObjDBMetaAttribute): HResult; stdcall;
       function GetQuery(out pVal: IObjDBQuery): HResult; stdcall;
       function GetPositionInQuery(out pVal: SYSINT): HResult; stdcall;
     end;

    // *********************************************************************//
    // Interface: IObjDBQueryFieldTimestamp
    // Flags:     (256) OleAutomation
    // GUID:      {16034C62-09D1-4E7C-BF14-F587137F8F8C}
    // *********************************************************************//
     IObjDBQueryFieldTimestamp = interface(IObjDBQueryField)
       ['{16034C62-09D1-4E7C-BF14-F587137F8F8C}']
       function GetValue(out pVal: TDateTime): HResult; stdcall;
       function SetParam(val1: TDateTime): HResult; stdcall;
       function SetBetweenParams(val1: TDateTime; val2: TDateTime): HResult; stdcall;
     end;

    // *********************************************************************//
    // Interface: IObjDBQueryFieldInteger
    // Flags:     (256) OleAutomation
    // GUID:      {FDB0244C-5B30-4C09-8F07-42A2845664B9}
    // *********************************************************************//
     IObjDBQueryFieldInteger = interface(IObjDBQueryField)
       ['{FDB0244C-5B30-4C09-8F07-42A2845664B9}']
       function GetValue(out pVal: SYSINT): HResult; stdcall;
       function SetParam(val1: SYSINT): HResult; stdcall;
       function SetBetweenParams(val1: SYSINT; val2: SYSINT): HResult; stdcall;
     end;

    // *********************************************************************//
    // Interface: IObjDBQueryFieldDouble
    // Flags:     (256) OleAutomation
    // GUID:      {38B668A5-2AA6-4919-B894-34A0AF9B8EBB}
    // *********************************************************************//
     IObjDBQueryFieldDouble = interface(IObjDBQueryField)
       ['{38B668A5-2AA6-4919-B894-34A0AF9B8EBB}']
       function GetValue(out pVal: Double): HResult; stdcall;
       function SetParam(val1: Double): HResult; stdcall;
       function SetBetweenParams(val1: Double; val2: Double): HResult; stdcall;
     end;

    // *********************************************************************//
    // Interface: IObjDBQueryFieldString
    // Flags:     (256) OleAutomation
    // GUID:      {9C7F8740-D53F-4239-93E3-1B2EE7DB5D07}
    // *********************************************************************//
     IObjDBQueryFieldString = interface(IObjDBQueryField)
       ['{9C7F8740-D53F-4239-93E3-1B2EE7DB5D07}']
       function GetValue(out pVal: WideString): HResult; stdcall;
       function SetParam(const val1: WideString): HResult; stdcall;
       function SetBetweenParams(const val1: WideString; const val2: WideString): HResult; stdcall;
     end;

  • systopler (18.08.07 07:16) [50]
    // *********************************************************************//
    // Interface: IObjDBQueryFieldBLOB
    // Flags:     (256) OleAutomation
    // GUID:      {D9AF9358-753B-4E82-9699-B36DF7BF3D85}
    // *********************************************************************//
     IObjDBQueryFieldBLOB = interface(IObjDBQueryField)
       ['{D9AF9358-753B-4E82-9699-B36DF7BF3D85}']
       function GetValue(out pVal: PSafeArray): HResult; stdcall;
       function GetValueVariant(out pVal: OleVariant): HResult; stdcall;
     end;

    // *********************************************************************//
    // Interface: IObjDBQueryFieldGUID
    // Flags:     (256) OleAutomation
    // GUID:      {713DA60E-CA0C-4A6B-9A8A-48C6B7EB48F7}
    // *********************************************************************//
     IObjDBQueryFieldGUID = interface(IObjDBQueryField)
       ['{713DA60E-CA0C-4A6B-9A8A-48C6B7EB48F7}']
       function GetValue(out pVal: TGUID): HResult; stdcall;
       function GetValueText(out pVal: WideString): HResult; stdcall;
       function SetParam(var val1: TGUID): HResult; stdcall;
       function SetParamText(const val1: WideString): HResult; stdcall;
     end;

    // *********************************************************************//
    // Interface: IObjDBQueryFieldBoolean
    // Flags:     (256) OleAutomation
    // GUID:      {9872B799-4D6B-4968-AA6E-CDCAAF1F5831}
    // *********************************************************************//
     IObjDBQueryFieldBoolean = interface(IObjDBQueryField)
       ['{9872B799-4D6B-4968-AA6E-CDCAAF1F5831}']
       function GetValue(out pVal: WordBool): HResult; stdcall;
       function SetParam(val1: WordBool): HResult; stdcall;
     end;

    // *********************************************************************//
    // Interface: IObjDBQueryFieldShape
    // Flags:     (256) OleAutomation
    // GUID:      {470B575D-5355-4E10-B9EE-A5012C37EB2E}
    // *********************************************************************//
     IObjDBQueryFieldShape = interface(IObjDBQueryField)
       ['{470B575D-5355-4E10-B9EE-A5012C37EB2E}']
       function GetValue(out pXMin: SYSINT; out pXMax: SYSINT; out pYMin: SYSINT; out pYMax: SYSINT;
                         out pVal: PSafeArray): HResult; stdcall;
       function GetValueVariant(out pXMin: SYSINT; out pXMax: SYSINT; out pYMin: SYSINT;
                                out pYMax: SYSINT; out pVal: OleVariant): HResult; stdcall;
       function SetIntersectParam(nXMin: SYSINT; nXMax: SYSINT; nYMin: SYSINT; nYMax: SYSINT): HResult; stdcall;
     end;

    // *********************************************************************//
    // The Class CoObjDB provides a Create and CreateRemote method to          
    // create instances of the default interface IObjDB exposed by              
    // the CoClass ObjDB. The functions are intended to be used by            
    // clients wishing to automate the CoClass objects exposed by the        
    // server of this typelibrary.                                            
    // *********************************************************************//
     CoObjDB = class
       class function Create: IObjDB;
       class function CreateRemote(const MachineName: string): IObjDB;
     end;

  • systopler (18.08.07 07:18) [51]
    // *********************************************************************//
    // OLE Server Proxy class declaration
    // Server Object    : TObjDB
    // Help String      : ObjDB Class
    // Default Interface: IObjDB
    // Def. Intf. DISP? : No
    // Event   Interface: _IObjDBEvents
    // TypeFlags        : (2) CanCreate
    // *********************************************************************//
    {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
     TObjDBProperties= class;
    {$ENDIF}
     TObjDB = class(TOleServer)
     private
       FIntf: IObjDB;
    {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
       FProps: TObjDBProperties;
       function GetServerProperties: TObjDBProperties;
    {$ENDIF}
       function GetDefaultInterface: IObjDB;
     protected
       procedure InitServerData; override;
       procedure InvokeEvent(DispID: TDispID; var Params: TVariantArray); override;
     public
       constructor Create(AOwner: TComponent); override;
       destructor  Destroy; override;
       procedure Connect; override;
       procedure ConnectTo(svrIntf: IObjDB);
       procedure Disconnect; override;
       function Connect1(const pXMLConnection: IXMLDOMNode; const bstrUserLogin: WideString;
                         const bstrUserPassword: WideString; out ppNewConnection: IObjDBConnection): HResult;
       function ConnectAdmin(const pXMLConnection: IXMLDOMNode; const bstrUserLogin: WideString;
                             const bstrUserPassword: WideString; const bstrDBALogin: WideString;
                             const bstrDBAPassword: WideString; bCreateBase: WordBool;
                             out ppNewConnection: IObjDBAdminConnection): HResult;
       property DefaultInterface: IObjDB read GetDefaultInterface;
     published
    {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
       property Server: TObjDBProperties read GetServerProperties;
    {$ENDIF}
     end;

    {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
    // *********************************************************************//
    // OLE Server Properties Proxy Class
    // Server Object    : TObjDB
    // (This object is used by the IDE's Property Inspector to allow editing
    //  of the properties of this server)
    // *********************************************************************//
    TObjDBProperties = class(TPersistent)
     private
       FServer:    TObjDB;
       function    GetDefaultInterface: IObjDB;
       constructor Create(AServer: TObjDB);
     protected
     public
       property DefaultInterface: IObjDB read GetDefaultInterface;
     published
     end;
    {$ENDIF}

    // *********************************************************************//
    // The Class CoObjDBMetaObjectAdmin provides a Create and CreateRemote method to          
    // create instances of the default interface IObjDBMetaObjectAdmin exposed by              
    // the CoClass ObjDBMetaObjectAdmin. The functions are intended to be used by            
    // clients wishing to automate the CoClass objects exposed by the        
    // server of this typelibrary.                                            
    // *********************************************************************//
     CoObjDBMetaObjectAdmin = class
       class function Create: IObjDBMetaObjectAdmin;
       class function CreateRemote(const MachineName: string): IObjDBMetaObjectAdmin;
     end;

  • systopler (18.08.07 07:19) [52]
    // *********************************************************************//
    // OLE Server Proxy class declaration
    // Server Object    : TObjDBMetaObjectAdmin
    // Help String      : ObjDBMetaObjectAdmin Class
    // Default Interface: IObjDBMetaObjectAdmin
    // Def. Intf. DISP? : No
    // Event   Interface:
    // TypeFlags        : (2) CanCreate
    // *********************************************************************//
    {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
     TObjDBMetaObjectAdminProperties= class;
    {$ENDIF}
     TObjDBMetaObjectAdmin = class(TOleServer)
     private
       FIntf: IObjDBMetaObjectAdmin;
    {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
       FProps: TObjDBMetaObjectAdminProperties;
       function GetServerProperties: TObjDBMetaObjectAdminProperties;
    {$ENDIF}
       function GetDefaultInterface: IObjDBMetaObjectAdmin;
     protected
       procedure InitServerData; override;
     public
       constructor Create(AOwner: TComponent); override;
       destructor  Destroy; override;
       procedure Connect; override;
       procedure ConnectTo(svrIntf: IObjDBMetaObjectAdmin);
       procedure Disconnect; override;
       function GetName(out pVal: WideString): HResult;
       function GetCode(out pVal: WideString): HResult;
       function IsRequired(out pVal: WordBool): HResult;
       function IsVersioned(out pVal: WordBool): HResult;
       function GetNameExpression(out pVal: WideString): HResult;
       function GetAttribute(const bstrCode: WideString; out ppMetaAttribute: IObjDBMetaAttribute): HResult;
       function GetAttributeIterator(out pVal: IObjDBMetaAttributeIterator): HResult;
       function MakeEmptyDataObject(out ppDataObject: IObjDBDataObject): HResult;
       function SetName(const newVal: WideString): HResult;
       function SetCode(const newVal: WideString): HResult;
       function SetRequired(newVal: WordBool): HResult;
       function SetVersioned(newVal: WordBool): HResult;
       function SetNameExpression(const newVal: WideString): HResult;
       function AddIntegerAttribute(const bstrCode: WideString; const bstrName: WideString;
                                    bIsRequired: WordBool; bIsNullable: WordBool;
                                    const bstrModPar: WideString;
                                    out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult;
       function AddDoubleAttribute(const bstrCode: WideString; const bstrName: WideString;
                                   bIsRequired: WordBool; bIsNullable: WordBool;
                                   const bstrModPar: WideString;
                                   out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult;
       function AddStringAttribute(const bstrCode: WideString; const bstrName: WideString;
                                   nLength: SYSINT; bIsRequired: WordBool;
                                   const bstrModPar: WideString;
                                   out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult;
       function AddBLOBAttribute(const bstrCode: WideString; const bstrName: WideString;
                                 bIsRequired: WordBool; bIsNullable: WordBool; nLength: SYSINT;
                                 const bstrModPar: WideString;
                                 out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult;
       function AddGUIDAttribute(const bstrCode: WideString; const bstrName: WideString;
                                 bIsRequired: WordBool; bIsNullable: WordBool;
                                 const bstrModPar: WideString;
                                 out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult;
       function AddBooleanAttribute(const bstrCode: WideString; const bstrName: WideString;
                                    bIsRequired: WordBool; const bstrModPar: WideString;
                                    out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult;
       function AddTimestampAttribute(const bstrCode: WideString; const bstrName: WideString;
                                      bIsRequired: WordBool; bIsNullable: WordBool;
                                      const bstrModPar: WideString;
                                      out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult;
       function AddShapeAttribute(const bstrCode: WideString; const bstrName: WideString;
                                  bIsRequired: WordBool; nLength: SYSINT;
                                  const bstrModPar: WideString;
                                  out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult;
       function AddDictRefAttribute(const bstrCode: WideString; const bstrName: WideString;
                                    bIsRequired: WordBool; bIsNullable: WordBool;
                                    const bstrModPar: WideString; const pRefObject: IObjDBMetaObject;
                                    out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult;
       function AddSubObjectAttribute(const bstrCode: WideString; const bstrName: WideString;
                                      bIsRequired: WordBool; const bstrModPar: WideString;
                                      const pRefObject: IObjDBMetaObject;
                                      out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult;
       function RemoveAttribute(const pMetaAttribute: IObjDBMetaAttributeAdmin): HResult;
       property DefaultInterface: IObjDBMetaObjectAdmin read GetDefaultInterface;
     published
    {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
       property Server: TObjDBMetaObjectAdminProperties read GetServerProperties;
    {$ENDIF}
     end;

  • systopler (18.08.07 07:20) [53]
    {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
    // *********************************************************************//
    // OLE Server Properties Proxy Class
    // Server Object    : TObjDBMetaObjectAdmin
    // (This object is used by the IDE's Property Inspector to allow editing
    //  of the properties of this server)
    // *********************************************************************//
    TObjDBMetaObjectAdminProperties = class(TPersistent)
     private
       FServer:    TObjDBMetaObjectAdmin;
       function    GetDefaultInterface: IObjDBMetaObjectAdmin;
       constructor Create(AServer: TObjDBMetaObjectAdmin);
     protected
     public
       property DefaultInterface: IObjDBMetaObjectAdmin read GetDefaultInterface;
     published
     end;
    {$ENDIF}

    procedure Register;

    resourcestring
     dtlServerPage = '
    geObjDB';

     dtlOcxPage = '
    geObjDB';

    implementation

    uses ComObj;

    class function CoObjDB.Create: IObjDB;
    begin
     Result := CreateComObject(CLASS_ObjDB) as IObjDB;
    end;

    class function CoObjDB.CreateRemote(const MachineName: string): IObjDB;
    begin
     Result := CreateRemoteComObject(MachineName, CLASS_ObjDB) as IObjDB;
    end;

    procedure TObjDB.InitServerData;
    const
     CServerData: TServerData = (
       ClassID:   '
    {98F6535A-79B2-409B-9068-07BB7E2EC61D}';
       IntfIID:   '
    {9B1611B2-F442-47B3-BE6E-463C82F28F6F}';
       EventIID:  '
    {7EAED95B-D75C-4729-8929-FC2E84580C41}';
       LicenseKey: nil;
       Version: 500);
    begin
     ServerData := @CServerData;
    end;

    procedure TObjDB.Connect;
    var
     punk: IUnknown;
    begin
     if FIntf = nil then
     begin
       punk := GetServer;
       ConnectEvents(punk);
       Fintf:= punk as IObjDB;
     end;
    end;

    procedure TObjDB.ConnectTo(svrIntf: IObjDB);
    begin
     Disconnect;
     FIntf := svrIntf;
     ConnectEvents(FIntf);
    end;

    procedure TObjDB.DisConnect;
    begin
     if Fintf <> nil then
     begin
       DisconnectEvents(FIntf);
       FIntf := nil;
     end;
    end;

    function TObjDB.GetDefaultInterface: IObjDB;
    begin
     if FIntf = nil then
       Connect;
     Assert(FIntf <> nil, '
    DefaultInterface is NULL. Component is not connected to Server. You must call "Connect" or "ConnectTo" before this operation');
     Result := FIntf;
    end;

    constructor TObjDB.Create(AOwner: TComponent);
    begin
     inherited Create(AOwner);
    {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
     FProps := TObjDBProperties.Create(Self);
    {$ENDIF}
    end;

    destructor TObjDB.Destroy;
    begin
    {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
     FProps.Free;
    {$ENDIF}
     inherited Destroy;
    end;

  • systopler (18.08.07 07:22) [54]
    {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
    function TObjDB.GetServerProperties: TObjDBProperties;
    begin
     Result := FProps;
    end;
    {$ENDIF}

    procedure TObjDB.InvokeEvent(DispID: TDispID; var Params: TVariantArray);
    begin
     case DispID of
       -1: Exit;  // DISPID_UNKNOWN
     end; {case DispID}
    end;

    function TObjDB.Connect1(const pXMLConnection: IXMLDOMNode; const bstrUserLogin: WideString;
                            const bstrUserPassword: WideString; out ppNewConnection: IObjDBConnection): HResult;
    begin
     Result := DefaultInterface.Connect(pXMLConnection, bstrUserLogin, bstrUserPassword,
                                        ppNewConnection);
    end;

    function TObjDB.ConnectAdmin(const pXMLConnection: IXMLDOMNode; const bstrUserLogin: WideString;
                                const bstrUserPassword: WideString; const bstrDBALogin: WideString;
                                const bstrDBAPassword: WideString; bCreateBase: WordBool;
                                out ppNewConnection: IObjDBAdminConnection): HResult;
    begin
     Result := DefaultInterface.ConnectAdmin(pXMLConnection, bstrUserLogin, bstrUserPassword,
                                             bstrDBALogin, bstrDBAPassword, bCreateBase,
                                             ppNewConnection);
    end;

    {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
    constructor TObjDBProperties.Create(AServer: TObjDB);
    begin
     inherited Create;
     FServer := AServer;
    end;

    function TObjDBProperties.GetDefaultInterface: IObjDB;
    begin
     Result := FServer.DefaultInterface;
    end;

    {$ENDIF}

  • systopler (18.08.07 07:23) [55]
    class function CoObjDBMetaObjectAdmin.Create: IObjDBMetaObjectAdmin;
    begin
     Result := CreateComObject(CLASS_ObjDBMetaObjectAdmin) as IObjDBMetaObjectAdmin;
    end;

    class function CoObjDBMetaObjectAdmin.CreateRemote(const MachineName: string): IObjDBMetaObjectAdmin;
    begin
     Result := CreateRemoteComObject(MachineName, CLASS_ObjDBMetaObjectAdmin) as IObjDBMetaObjectAdmin;
    end;

    procedure TObjDBMetaObjectAdmin.InitServerData;
    const
     CServerData: TServerData = (
       ClassID:   '{6CCD0008-9654-4B38-AA9B-86274069A899}';
       IntfIID:   '{09D9074A-A60C-43B1-B2BD-9F25E13CA86F}';
       EventIID:  '';
       LicenseKey: nil;
       Version: 500);
    begin
     ServerData := @CServerData;
    end;

    procedure TObjDBMetaObjectAdmin.Connect;
    var
     punk: IUnknown;
    begin
     if FIntf = nil then
     begin
       punk := GetServer;
       Fintf:= punk as IObjDBMetaObjectAdmin;
     end;
    end;

    procedure TObjDBMetaObjectAdmin.ConnectTo(svrIntf: IObjDBMetaObjectAdmin);
    begin
     Disconnect;
     FIntf := svrIntf;
    end;

    procedure TObjDBMetaObjectAdmin.DisConnect;
    begin
     if Fintf <> nil then
     begin
       FIntf := nil;
     end;
    end;

    function TObjDBMetaObjectAdmin.GetDefaultInterface: IObjDBMetaObjectAdmin;
    begin
     if FIntf = nil then
       Connect;
     Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call \"Connect\" or \"ConnectTo\" before this operation');
     Result := FIntf;
    end;

    constructor TObjDBMetaObjectAdmin.Create(AOwner: TComponent);
    begin
     inherited Create(AOwner);
    {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
     FProps := TObjDBMetaObjectAdminProperties.Create(Self);
    {$ENDIF}
    end;

    destructor TObjDBMetaObjectAdmin.Destroy;
    begin
    {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
     FProps.Free;
    {$ENDIF}
     inherited Destroy;
    end;

  • systopler (18.08.07 07:24) [56]
    {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
    function TObjDBMetaObjectAdmin.GetServerProperties: TObjDBMetaObjectAdminProperties;
    begin
     Result := FProps;
    end;
    {$ENDIF}

    function TObjDBMetaObjectAdmin.GetName(out pVal: WideString): HResult;
    begin
     Result := DefaultInterface.GetName(pVal);
    end;

    function TObjDBMetaObjectAdmin.GetCode(out pVal: WideString): HResult;
    begin
     Result := DefaultInterface.GetCode(pVal);
    end;

    function TObjDBMetaObjectAdmin.IsRequired(out pVal: WordBool): HResult;
    begin
     Result := DefaultInterface.IsRequired(pVal);
    end;

    function TObjDBMetaObjectAdmin.IsVersioned(out pVal: WordBool): HResult;
    begin
     Result := DefaultInterface.IsVersioned(pVal);
    end;

    function TObjDBMetaObjectAdmin.GetNameExpression(out pVal: WideString): HResult;
    begin
     Result := DefaultInterface.GetNameExpression(pVal);
    end;

    function TObjDBMetaObjectAdmin.GetAttribute(const bstrCode: WideString;
                                               out ppMetaAttribute: IObjDBMetaAttribute): HResult;
    begin
     Result := DefaultInterface.GetAttribute(bstrCode, ppMetaAttribute);
    end;

    function TObjDBMetaObjectAdmin.GetAttributeIterator(out pVal: IObjDBMetaAttributeIterator): HResult;
    begin
     Result := DefaultInterface.GetAttributeIterator(pVal);
    end;

    function TObjDBMetaObjectAdmin.MakeEmptyDataObject(out ppDataObject: IObjDBDataObject): HResult;
    begin
     Result := DefaultInterface.MakeEmptyDataObject(ppDataObject);
    end;

    function TObjDBMetaObjectAdmin.SetName(const newVal: WideString): HResult;
    begin
     Result := DefaultInterface.SetName(newVal);
    end;

    function TObjDBMetaObjectAdmin.SetCode(const newVal: WideString): HResult;
    begin
     Result := DefaultInterface.SetCode(newVal);
    end;

    function TObjDBMetaObjectAdmin.SetRequired(newVal: WordBool): HResult;
    begin
     Result := DefaultInterface.SetRequired(newVal);
    end;

    function TObjDBMetaObjectAdmin.SetVersioned(newVal: WordBool): HResult;
    begin
     Result := DefaultInterface.SetVersioned(newVal);
    end;

    function TObjDBMetaObjectAdmin.SetNameExpression(const newVal: WideString): HResult;
    begin
     Result := DefaultInterface.SetNameExpression(newVal);
    end;

  • systopler (18.08.07 07:25) [57]
    function TObjDBMetaObjectAdmin.AddIntegerAttribute(const bstrCode: WideString;
                                                      const bstrName: WideString;
                                                      bIsRequired: WordBool; bIsNullable: WordBool;
                                                      const bstrModPar: WideString;
                                                      out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult;
    begin
     Result := DefaultInterface.AddIntegerAttribute(bstrCode, bstrName, bIsRequired, bIsNullable,
                                                    bstrModPar, ppMetaAttribute);
    end;

    function TObjDBMetaObjectAdmin.AddDoubleAttribute(const bstrCode: WideString;
                                                     const bstrName: WideString;
                                                     bIsRequired: WordBool; bIsNullable: WordBool;
                                                     const bstrModPar: WideString;
                                                     out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult;
    begin
     Result := DefaultInterface.AddDoubleAttribute(bstrCode, bstrName, bIsRequired, bIsNullable,
                                                   bstrModPar, ppMetaAttribute);
    end;

    function TObjDBMetaObjectAdmin.AddStringAttribute(const bstrCode: WideString;
                                                     const bstrName: WideString; nLength: SYSINT;
                                                     bIsRequired: WordBool;
                                                     const bstrModPar: WideString;
                                                     out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult;
    begin
     Result := DefaultInterface.AddStringAttribute(bstrCode, bstrName, nLength, bIsRequired,
                                                   bstrModPar, ppMetaAttribute);
    end;

    function TObjDBMetaObjectAdmin.AddBLOBAttribute(const bstrCode: WideString;
                                                   const bstrName: WideString; bIsRequired: WordBool;
                                                   bIsNullable: WordBool; nLength: SYSINT;
                                                   const bstrModPar: WideString;
                                                   out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult;
    begin
     Result := DefaultInterface.AddBLOBAttribute(bstrCode, bstrName, bIsRequired, bIsNullable,
                                                 nLength, bstrModPar, ppMetaAttribute);
    end;

    function TObjDBMetaObjectAdmin.AddGUIDAttribute(const bstrCode: WideString;
                                                   const bstrName: WideString; bIsRequired: WordBool;
                                                   bIsNullable: WordBool;
                                                   const bstrModPar: WideString;
                                                   out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult;
    begin
     Result := DefaultInterface.AddGUIDAttribute(bstrCode, bstrName, bIsRequired, bIsNullable,
                                                 bstrModPar, ppMetaAttribute);
    end;

    function TObjDBMetaObjectAdmin.AddBooleanAttribute(const bstrCode: WideString;
                                                      const bstrName: WideString;
                                                      bIsRequired: WordBool;
                                                      const bstrModPar: WideString;
                                                      out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult;
    begin
     Result := DefaultInterface.AddBooleanAttribute(bstrCode, bstrName, bIsRequired, bstrModPar,
                                                    ppMetaAttribute);
    end;

  • systopler (18.08.07 07:25) [58]
    function TObjDBMetaObjectAdmin.AddTimestampAttribute(const bstrCode: WideString;
                                                        const bstrName: WideString;
                                                        bIsRequired: WordBool; bIsNullable: WordBool;
                                                        const bstrModPar: WideString;
                                                        out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult;
    begin
     Result := DefaultInterface.AddTimestampAttribute(bstrCode, bstrName, bIsRequired, bIsNullable,
                                                      bstrModPar, ppMetaAttribute);
    end;

    function TObjDBMetaObjectAdmin.AddShapeAttribute(const bstrCode: WideString;
                                                    const bstrName: WideString; bIsRequired: WordBool;
                                                    nLength: SYSINT; const bstrModPar: WideString;
                                                    out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult;
    begin
     Result := DefaultInterface.AddShapeAttribute(bstrCode, bstrName, bIsRequired, nLength,
                                                  bstrModPar, ppMetaAttribute);
    end;

    function TObjDBMetaObjectAdmin.AddDictRefAttribute(const bstrCode: WideString;
                                                      const bstrName: WideString;
                                                      bIsRequired: WordBool; bIsNullable: WordBool;
                                                      const bstrModPar: WideString;
                                                      const pRefObject: IObjDBMetaObject;
                                                      out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult;
    begin
     Result := DefaultInterface.AddDictRefAttribute(bstrCode, bstrName, bIsRequired, bIsNullable,
                                                    bstrModPar, pRefObject, ppMetaAttribute);
    end;

    function TObjDBMetaObjectAdmin.AddSubObjectAttribute(const bstrCode: WideString;
                                                        const bstrName: WideString;
                                                        bIsRequired: WordBool;
                                                        const bstrModPar: WideString;
                                                        const pRefObject: IObjDBMetaObject;
                                                        out ppMetaAttribute: IObjDBMetaAttributeAdmin): HResult;
    begin
     Result := DefaultInterface.AddSubObjectAttribute(bstrCode, bstrName, bIsRequired, bstrModPar,
                                                      pRefObject, ppMetaAttribute);
    end;

    function TObjDBMetaObjectAdmin.RemoveAttribute(const pMetaAttribute: IObjDBMetaAttributeAdmin): HResult;
    begin
     Result := DefaultInterface.RemoveAttribute(pMetaAttribute);
    end;

    {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
    constructor TObjDBMetaObjectAdminProperties.Create(AServer: TObjDBMetaObjectAdmin);
    begin
     inherited Create;
     FServer := AServer;
    end;

    function TObjDBMetaObjectAdminProperties.GetDefaultInterface: IObjDBMetaObjectAdmin;
    begin
     Result := FServer.DefaultInterface;
    end;

    {$ENDIF}

    procedure Register;
    begin
     RegisterComponents(dtlServerPage, [TObjDB, TObjDBMetaObjectAdmin]);
    end;

    end.

 
Конференция "Corba" » Ошибка при подключении interface в Com объекте [Delphi, Windows]
Есть новые Нет новых   [134431   +9][b:0][p:0.04]