Hallo himitsu,
danke für den Hinweis.
Hilft mir aber nicht weiter.
Ich interpretiere
Delphi-Quellcode:
procedure GetReferenceKey(var ReferenceKey: {NOT_OLEAUTO(PSafeArray)}OleVariant;
KeyContext: Integer); dispid 2130706454;
analog dazu liefert Free Pascal
// Warning: 'PSafeArray' not automatable in ModelStatedisp.GetReferenceKey
nun so, daß das mit Pascal nicht geht und gebe auf.
Liefert der type library import auch ein dual interface neben dem dispinterface? Wenn ja solltest Du lieber das verwenden, da kann man notfalls die generierte Deklaration der Methode anpassen wenn der type library importer das nicht richtig gemacht hat.
Ich hatte mal ein dispinterface, das nicht wirklich automation-kompatible Methoden enthielt. Da half dann sowas:
Delphi-Quellcode:
{PB 2005-10-07 The VoidPtrToBufID function does not work as declared by the
type library importer. Removing the Var for the buffer parameter makes it
work, though. }
function VoidPtrToBufID({var} buffer: {??Pointer} OleVariant; bufflen: Integer): Integer; dispid 20007;
Verwendung:
Delphi-Quellcode:
{!
<summary>
CreateSketchFromBuffer is a helper routine, it reads a sketch from
a memory buffer.</summary>
<returns>
an ISIS sketch handle, or INVALID_ID, if the read failed. The caller
has to eventually release this handle via the DeleteSketch method of
the ISIS automation server.</returns>
<param name="pData">
is the buffer's address.</param>
<param name="len">is the length of the data, in bytes.</param>
}
function TIsisMolinfoHelper.CreateSketchFromBuffer(pData: Pointer; Len:
integer): Integer;
var
hSketch: Integer;
V: TVarData;
BufID: Integer;
begin
{$IFDEF LOGDETAIL}
Logmanager.Log('
Start - TIsisMolinfoHelper.CreateSketchFromBuffer');
{$ENDIF}
Result := INVALID_ID;
V.VType := VT_PTR;
V.VPointer := pData;
{$IFDEF LOGDETAIL}
Logmanager.Log('
TIsisMolinfoHelper.CreateSketchFromBuffer - calling VoidPtrToBufID');
{$ENDIF}
BufID := Isis.VoidPtrToBufID(Olevariant(V), Len);
if BufID > 0
then
try
{$IFDEF LOGDETAIL}
Logmanager.Log('
TIsisMolinfoHelper.CreateSketchFromBuffer - calling ReadSketchFromBuffer');
{$ENDIF}
hSketch := Isis.ReadSketchFromBuffer(BufID);
{$IFDEF LOGDETAIL}
Logmanager.Log('
TIsisMolinfoHelper.CreateSketchFromBuffer - ReadSketchFromBuffer returned');
{$ENDIF}
if hSketch <> INVALID_ID
then
Result := hSketch
else begin
{$IFDEF DEBUG}
Logmanager.Log('
CreateSketchFromBuffer: ReadSketchFromBuffer failed.');
{$ENDIF}
end;
{ Else }
finally
isis.DeleteBuffer(BufID);
end { finally }
else begin
{$IFDEF DEBUG}
Logmanager.Log('
CreateSketchFromBuffer: VoidPtrToBufID failed.');
{$ENDIF}
end;
{ Else }
end;