-
Всем привет!!! Я жил, не тужил, народу помогал , короче был хорошим и послушным, но тут случилось бяка… А бяка заключалась в том, что мне дали Dll-ку с которой мне нуна активно поработать
Я не долго думая сделал «Import Component», в результате получил файл *_TLB.pas, который подключил к своему проекту. … const LIBID_deObjDBLib: TGUID = '{741B2D1D-A526-459B-8039-A9D5B4C42391}';
IID_IObjDB: TGUID = '{9B1611B2-F442-47B3-BE6E-463C82F28F6F}'; CLASS_ObjDB: TGUID = '{98F6535A-79B2-409B-9068-07BB7E2EC61D}'; ....
IObjDB = interface(IUnknown) ['{9B1611B2-F442-47B3-BE6E-463C82F28F6F}'] …. CoObjDB = class class function Create: IObjDB; class function CreateRemote(const MachineName: string): IObjDB; end; …
Бросил на форму кнопарь и прописал следующий код: procedure TForm1.Button1Click(Sender: TObject); var v : IObjDB; a : CoObjDB; begin v := a.Create; end;
Думал, что вот оно – счастье, а нет, оказалась «Ж»…
при выполнении этого кода вылетает ошибка… что тока не делал... даже мышку почистил, но не помогло... Какой необходимо исполнить танец с бубном, чтобы заработало?
-
regsvr32 DllName.dll
-
Не помогает.
VBA и C# нормально работают с этой Dll-кой, а вот Delphi не хочет :(
-
> Думал, что вот оно – счастье, а нет, оказалась «Ж»…
какая именно «Ж»? Дословно, если можно
-
Ж - попа, тока на букву Ж
-
>systopler
C Ж всем понятно, а вот какой текст ошибки ?
-
procedure TForm1.Button1Click(Sender: TObject); var v : IObjDB; a : CoObjDB; begin a := CoObjDB.Create; v:= a as IObjDB; end;
-
Ошибка: OLE error C000001D, ClassID:{98F6535A-79B2-409B-9068-07BB7E2EC61D}
-
> procedure TForm1.Button1Click(Sender: TObject);
> var
> v :;
> a : CoObjDB;
> begin
> a := CoObjDB.Create;
> v:= a as IObjDB;
> end;
так нельзя т.к. "a : CoObjDB" , а CoObjDB.Create возвращает IObjDB
-
> procedure TForm1.Button1Click(Sender: TObject);
> var
> v :;
> a : CoObjDB;
> begin
> a := CoObjDB.Create;
> v:= a as IObjDB;
> end;
так нельзя т.к. "a : CoObjDB" , а CoObjDB.Create возвращает IObjDB
-
>systopler
LoadLibrary пробовали ?
-
procedure TForm1.Button1Click(Sender: TObject);
var
СreateObject : procedure (IID:TGUID; out Obj);
_Mod : Integer;
mainObjDB : ObjDB;
begin
_Mod := LoadLibrary(PChar('C:\Dgpp\bin\deObjDB.dll'));
try
СreateObject := GetProcAddress (_Mod, 'CreateObject');
СreateObject (IObjDB, mainObjDB);
finally
FreeLibrary (_Mod);
end;
end;
в коде СreateObject (IObjDB, mainObjDB); выдает сообщение об ошибке Access violation at address 00000000. Read of address 00000000
-
procedure TForm1.Button1Click(Sender: TObject);
var
СreateObject : procedure (IID:TGUID; out Obj);
_Mod : Integer;
mainObjDB : IObjDB;
begin
_Mod := LoadLibrary(PChar('C:\Dgpp\bin\deObjDB.dll'));
try
СreateObject := GetProcAddress (_Mod, 'CreateObject');
if @СreateObject = nil then begin
MessageBox (0, 'СreateObject = nil', '', MB_OK);
exit;
end;
СreateObject (IObjDB, mainObjDB);
finally
FreeLibrary (_Mod);
end;
end;
Выходит сообшение, что СreateObject = nil
-
>systopler (17.08.07 13:39) [12]
А _Mod ?
Перейти в каталог deObjDB.dll ? (SetCurrentDirectory)
-
procedure TForm1.Button1Click(Sender: TObject);
var
СreateObject : procedure (IID:TGUID; out Obj);
_Mod : Integer;
mainObjDB : IObjDB;
begin
SetCurrentDirectory ('C:\');
_Mod := LoadLibrary ('C:\deObjDB.dll');
if _Mod = 0 then begin
MessageBox (0, 'Библиотека не загрузилась :(', '', MB_OK);
exit;
end;
try
СreateObject := GetProcAddress (_Mod, 'CreateObject');
if not Assigned(@СreateObject) then MessageBox (0, 'СreateObject = nil', '', MB_OK)
else СreateObject (IObjDB, mainObjDB);
finally
FreeLibrary (_Mod);
end;
end; Действительно _Mod=0чтобы я не делал *.dll-ка не хочет открываться :(
-
Проверить ее depends.exe (если есть).
Попробовать CoLoadLibrary ?
-
можно подробней об этой функции, и совсем круто будет если будет примерчик
-
deObjDB.dll – использует OLE для работы с XML. Есть вероятность, что вся проблема в этом?
-
-
в результате этого кода _Mod := LoadLibrary ('C:\deObjDB.dll');
str := IntToStr(GetLastError);
str = '3221225501'
-
у меня с инетом не очень :( не могу достучаться до странички, которую ты мне скинул... можешь сказать в двух словах?
-
>3221225501' C000001D
CoLoadLibrary
Loads a specific DLL into the caller's process. CoLoadLibrary is equivalent to LoadLibraryEx. CoLoadLibrary does not do anything about the lifetime of the library.
Copy Code
HINSTANCE CoLoadLibrary(
LPOLESTR lpszLibName,
BOOL bAutoFree
);
Parameters
lpszLibName
[in] Points to the name of the library to be loaded. The use of this name is the same as in the Win32 function LoadLibrary.
bAutoFree
[in] If TRUE, indicates that this library is freed when it is no longer needed, through a call to either the CoFreeUnusedLibraries or CoUninitialize functions. If FALSE, the library should be explicitly freed with the CoFreeLibrary function.
Note:
The bAutoFree parameter is used only for 16-bit applications. This parameter is ignored for 32-bit and 64-bit applications.
Return Values
Module Handle
Handle of the loaded library.
NULL
Library could not be loaded.
Remarks
The CoGetClassObject function does not call CoLoadLibrary. CoLoadLibrary loads a DLL specified by the lpszLibName parameter into the process that called CoGetClassObject. Containers should not call CoLoadLibrary directly.
Internally, a reference count is kept on the loaded DLL, by using CoLoadLibrary to increment the count and the CoFreeLibrary function to decrement it.
А в VBA и С# работает в тестовых проектах ?
-
> systopler
> не долго думая сделал «Import Component»
Для начала делай как положено - "Import Type Library .."
Устанавливать соотв.компонент совсем не обязательно, хотя такая возможность будет тебе предложена в ходе работы импорт-визарда.
И с бубном прыгать тоже не обязательно - у тебя есть VB-код, успешно работающий с той библ-кой, вот его и портируй в Делфи-код.
Если есть сомнения, приводи сюда этот VB-код, от него и надо плясать.
-
Спасибо. > > не долго думая сделал «Import Component» > Для начала делай как положено - "Import Type Library .."
Я так и сделал. "Import Type Library .." появляется после того как в меню нажимаешь на «Import Component» Работающий код на VBA: Public Type TParamConnect
Base As String
Server As String
BackupPath As String
User As String
Password As String
End Type
Public Function ConnectAdd(ParamCon As TParamConnect, strAliasDb As String) As deObjDBLib.IObjDBConnection
Dim pXmlDoc As New MSXML2.DOMDocument
Dim xmlField As IXMLDOMElement
Dim pObjDb As New deObjDBLib.ObjDB
Set xmlField = pXmlDoc.appendChild(pXmlDoc.createElement("CONNECTION"))
xmlField.setAttribute "Base", ParamCon.Base
xmlField.setAttribute "Server", ParamCon.Server
xmlField.setAttribute "BackupPath", ParamCon.BackupPath
Dim pNewConn As deObjDBLib.IObjDBConnection
Set pNewConn = pObjDb.Connect(xmlField, ParamCon.User, ParamCon.Password)
Set ConnectAdd = pNewConn
End Function
-
Видимо надо попробовать оставить одну строчку
Dim pObjDb As New deObjDBLib.ObjDB
-
Я чего-то не уловил мысли. Зачем и где оставить одну строчку?
-
>systopler (17.08.07 15:40) [25] Тестовый проект на VBA
Dim pObjDb As New deObjDBLib.ObjDB
-
> systopler (17.08.07 05:32)
procedure TForm1.Button1Click(Sender: TObject);
var
v : IObjDB;
begin
v := CoObjDB.Create;
end;
-
в VBA так делать нельзя. верней, можно, но этот код ничего не даст. (эта строчка просто игнорится) Этот код отлично работает: Sub Макрос1()
'
' Макрос1 Макрос
'
Dim pObjDb As deObjDBLib.ObjDB
Set pObjDb = New deObjDBLib.ObjDB
Set pObjDb = Nothing
'
End Sub
-
> procedure TForm1.Button1Click(Sender: TObject);
> var
> v : IObjDB;
> begin
> v := CoObjDB.Create;
> end;
Выдает туже самую ошибку.
-
>systopler (17.08.07 16:11) [28]
Код был взят из systopler (17.08.07 15:06) [23]
CoInitFlags не пробовали менять в начале проекта Delphi ?
-
procedure TForm1.FormCreate(Sender: TObject);
begin
CoInitFlags := Х;
end;
где Х я ставил: COINIT_MULTITHREADED, COINIT_APARTMENTTHREADED, COINIT_DISABLE_OLE1DDE и COINIT_SPEED_OVER_MEMORY результат один и тот же...
-
Спросил у яндекса, что за ошибка C000001D, везде говорят, что виновата библиотека, ошибка в ней...
-
>systopler (17.08.07 16:49) [31]
Project-View Source
Перед Application.Initialize;
-
Уже и там сделал, но результат тот же.
-
Почему VBA открывает и работает с Dll-кой, а Delphi не хочет?
-
>systopler (17.08.07 17:31) [35]
Модуль не коммерческий ?
-
А systopler (17.08.07 16:11) [28] где пробовали ?
-
Коммерческий... мне его дали на расширение, т.е. я должен сделать еще несколько Com объектов (в другой dll-ки), которые будут АКТИВНО использовать эту Dll-ку.
-
>systopler (17.08.07 17:38) [38]
Попробуйте без отладчика.
-
без кода xxx_tlb.pas не разберешься. Недавно тут была подобная тема, когда ОЛЕ-сервер работал в C#, но не работал в делфи. такое впечатление, что в C# расширено множество OLE-совместимых типов. Весь код не надо, можно только обїявления типов.
-
unit deObjDBLib_TLB;
interface
uses Windows, ActiveX, Classes, Graphics, MSXML_TLB, OleServer, StdVCL, Variants;
const
deObjDBLibMajorVersion = 1;
deObjDBLibMinorVersion = 0;
LIBID_deObjDBLib: TGUID = '';
IID_IObjDB: TGUID = '';
IID_IObjDBConnection: TGUID = '';
IID_IObjDBTransaction: TGUID = '';
IID_IObjDBDataObject: TGUID = '';
IID_IObjDBMetaObject: TGUID = '';
IID_IObjDBMetaAttribute: TGUID = '';
IID_IObjDBMetaAttributeIterator: TGUID = '';
IID_IObjDBDataObjectList: TGUID = '';
IID_IObjDBDataObjectIterator: TGUID = '';
IID_IObjDBQuery: TGUID = '';
IID_IObjDBQueryField: TGUID = '';
IID_IObjDBFieldIterator: TGUID = '';
IID_IObjDBSubQueryIterator: TGUID = '';
IID_IObjDBMetadata: TGUID = '';
IID_IObjDBMetaObjectIterator: TGUID = '';
IID_IObjDBAdminConnection: TGUID = '';
IID_IObjDBMetadataAdmin: TGUID = '';
IID_IObjDBMetaObjectAdmin: TGUID = '';
IID_IObjDBMetaAttributeAdmin: TGUID = '';
DIID__IObjDBEvents: TGUID = '';
CLASS_ObjDB: TGUID = '';
IID_IObjDBImportTransaction: TGUID = '';
IID_IObjDBRiskyTransaction: TGUID = '';
DIID__IObjDBTransactionEvents: TGUID = '';
DIID__IObjDBConnectionEvents: TGUID = '';
DIID__IObjDBAdminConnectionEvents: TGUID = '';
IID_IObjDBConnectionLifeControl: TGUID = '';
CLASS_ObjDBMetaObjectAdmin: TGUID = '';
IID_IObjDBQueryFieldInfo: TGUID = '';
IID_IObjDBQueryFieldTimestamp: TGUID = '';
IID_IObjDBQueryFieldInteger: TGUID = '';
IID_IObjDBQueryFieldDouble: TGUID = '';
IID_IObjDBQueryFieldString: TGUID = '';
IID_IObjDBQueryFieldBLOB: TGUID = '';
IID_IObjDBQueryFieldGUID: TGUID = '';
IID_IObjDBQueryFieldBoolean: TGUID = '';
IID_IObjDBQueryFieldShape: TGUID = '';
-
type
EODBTransactionType = TOleEnum;
const
ODBTrReadReport = $00000000;
ODBTrReadCommited = $00000001;
ODBTrWriteMassUpdate = $00000002;
ODBTrWriteSingleUpdate = $00000003;
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;
type
EODBQueryVersionScope = TOleEnum;
const
ODBQVSActual = $00000000;
ODBQVSAllVersions = $00000001;
ODBQVSDeleted = $00000002;
type
EODBTransactionCloseReason = TOleEnum;
const
ODBTrCloseByCommit = $00000000;
ODBTrCloseByRollback = $00000001;
ODBTrCloseByDisconnect = $00000002;
type
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;
-
ObjDB = IObjDB;
ObjDBMetaObjectAdmin = IObjDBMetaObjectAdmin;
PUserType1 = ^TGUID;
IObjDB = interface(IUnknown)
['']
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;
IObjDBConnection = interface(IUnknown)
['']
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;
IObjDBTransaction = interface(IUnknown)
['']
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;
-
IObjDBDataObject = interface(IUnknown)
['']
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;
IObjDBMetaObject = interface(IUnknown)
['']
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;
-
IObjDBMetaAttribute = interface(IUnknown)
['']
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;
IObjDBMetaAttributeIterator = interface(IUnknown)
['']
function GetNextAttribute(out ppMetaAttribute: IObjDBMetaAttribute): HResult; stdcall;
end;
IObjDBDataObjectList = interface(IUnknown)
['']
function GetDataObjectIterator(out pVal: IObjDBDataObjectIterator): HResult; stdcall;
function AddNewDataObject(out ppDataObject: IObjDBDataObject): HResult; stdcall;
function RemoveDataObject(const pDataObject: IObjDBDataObject): HResult; stdcall;
end;
IObjDBDataObjectIterator = interface(IUnknown)
['']
function GetNextDataObject(out ppDataObject: IObjDBDataObject): HResult; stdcall;
end;
-
IObjDBQuery = interface(IUnknown)
['']
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;
IObjDBQueryField = interface(IUnknown)
['']
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;
IObjDBFieldIterator = interface(IUnknown)
['']
function GetNextField(out ppField: IObjDBQueryField): HResult; stdcall;
end;
IObjDBSubQueryIterator = interface(IUnknown)
['']
function GetNextSubQuery(out ppQuery: IObjDBQuery): HResult; stdcall;
end;
IObjDBMetadata = interface(IUnknown)
['']
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;
-
IObjDBMetaObjectIterator = interface(IUnknown)
['']
function GetNextMetaObject(out ppMetaObject: IObjDBMetaObject): HResult; stdcall;
end;
IObjDBAdminConnection = interface(IObjDBConnection)
['']
function BackupDatabase(const bstrBackupFile: WideString): HResult; stdcall;
function RestoreIndices: HResult; stdcall;
end;
IObjDBMetadataAdmin = interface(IObjDBMetadata)
['']
function AddMetaObject(const pMetaObject: IObjDBMetaObjectAdmin): HResult; stdcall;
function RemoveMetaObject(const pMetaObject: IObjDBMetaObjectAdmin): HResult; stdcall;
function ApplyObjectStructure(const pXMLObjStruct: IXMLDOMNode): HResult; stdcall;
end;
IObjDBMetaObjectAdmin = interface(IObjDBMetaObject)
['']
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;
-
IObjDBMetaAttributeAdmin = interface(IObjDBMetaAttribute)
['']
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;
_IObjDBEvents = dispinterface
['']
end;
IObjDBImportTransaction = interface(IUnknown)
['']
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;
IObjDBRiskyTransaction = interface(IUnknown)
['']
function Insert(const pDataObject: IObjDBDataObject; nId: Integer): HResult; stdcall;
end;
_IObjDBTransactionEvents = dispinterface
['']
procedure TransactionClosed(eCloseReason: EODBTransactionCloseReason); dispid 1;
end;
_IObjDBConnectionEvents = dispinterface
['']
end;
_IObjDBAdminConnectionEvents = dispinterface
['']
end;
-
IObjDBConnectionLifeControl = interface(IUnknown)
['']
function CloseConnection: HResult; stdcall;
end;
IObjDBQueryFieldInfo = interface(IUnknown)
['']
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;
IObjDBQueryFieldTimestamp = interface(IObjDBQueryField)
['']
function GetValue(out pVal: TDateTime): HResult; stdcall;
function SetParam(val1: TDateTime): HResult; stdcall;
function SetBetweenParams(val1: TDateTime; val2: TDateTime): HResult; stdcall;
end;
IObjDBQueryFieldInteger = interface(IObjDBQueryField)
['']
function GetValue(out pVal: SYSINT): HResult; stdcall;
function SetParam(val1: SYSINT): HResult; stdcall;
function SetBetweenParams(val1: SYSINT; val2: SYSINT): HResult; stdcall;
end;
IObjDBQueryFieldDouble = interface(IObjDBQueryField)
['']
function GetValue(out pVal: Double): HResult; stdcall;
function SetParam(val1: Double): HResult; stdcall;
function SetBetweenParams(val1: Double; val2: Double): HResult; stdcall;
end;
IObjDBQueryFieldString = interface(IObjDBQueryField)
['']
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;
-
IObjDBQueryFieldBLOB = interface(IObjDBQueryField)
['']
function GetValue(out pVal: PSafeArray): HResult; stdcall;
function GetValueVariant(out pVal: OleVariant): HResult; stdcall;
end;
IObjDBQueryFieldGUID = interface(IObjDBQueryField)
['']
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;
IObjDBQueryFieldBoolean = interface(IObjDBQueryField)
['']
function GetValue(out pVal: WordBool): HResult; stdcall;
function SetParam(val1: WordBool): HResult; stdcall;
end;
IObjDBQueryFieldShape = interface(IObjDBQueryField)
['']
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;
CoObjDB = class
class function Create: IObjDB;
class function CreateRemote(const MachineName: string): IObjDB;
end;
-
TObjDBProperties= class;
TObjDB = class(TOleServer)
private
FIntf: IObjDB;
FProps: TObjDBProperties;
function GetServerProperties: TObjDBProperties;
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
property Server: TObjDBProperties read GetServerProperties;
end;
TObjDBProperties = class(TPersistent)
private
FServer: TObjDB;
function GetDefaultInterface: IObjDB;
constructor Create(AServer: TObjDB);
protected
public
property DefaultInterface: IObjDB read GetDefaultInterface;
published
end;
CoObjDBMetaObjectAdmin = class
class function Create: IObjDBMetaObjectAdmin;
class function CreateRemote(const MachineName: string): IObjDBMetaObjectAdmin;
end;
-
TObjDBMetaObjectAdminProperties= class;
TObjDBMetaObjectAdmin = class(TOleServer)
private
FIntf: IObjDBMetaObjectAdmin;
FProps: TObjDBMetaObjectAdminProperties;
function GetServerProperties: TObjDBMetaObjectAdminProperties;
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
property Server: TObjDBMetaObjectAdminProperties read GetServerProperties;
end;
-
// 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;
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: '';
IntfIID: '';
EventIID: '';
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);
FProps := TObjDBProperties.Create(Self);
end;
destructor TObjDB.Destroy;
begin
FProps.Free;
inherited Destroy;
end;
-
function TObjDB.GetServerProperties: TObjDBProperties;
begin
Result := FProps;
end;
procedure TObjDB.InvokeEvent(DispID: TDispID; var Params: TVariantArray);
begin
case DispID of
-1: Exit; end;
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;
constructor TObjDBProperties.Create(AServer: TObjDB);
begin
inherited Create;
FServer := AServer;
end;
function TObjDBProperties.GetDefaultInterface: IObjDB;
begin
Result := FServer.DefaultInterface;
end;
-
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: '';
IntfIID: '';
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);
FProps := TObjDBMetaObjectAdminProperties.Create(Self);
end;
destructor TObjDBMetaObjectAdmin.Destroy;
begin
FProps.Free;
inherited Destroy;
end;
-
function TObjDBMetaObjectAdmin.GetServerProperties: TObjDBMetaObjectAdminProperties;
begin
Result := FProps;
end;
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;
-
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;
-
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;
constructor TObjDBMetaObjectAdminProperties.Create(AServer: TObjDBMetaObjectAdmin);
begin
inherited Create;
FServer := AServer;
end;
function TObjDBMetaObjectAdminProperties.GetDefaultInterface: IObjDBMetaObjectAdmin;
begin
Result := FServer.DefaultInterface;
end;
procedure Register;
begin
RegisterComponents(dtlServerPage, [TObjDB, TObjDBMetaObjectAdmin]);
end;
end.
|