Einzelnen Beitrag anzeigen

Benutzerbild von sx2008
sx2008

Registriert seit: 16. Feb 2008
Ort: Baden-Württemberg
2.332 Beiträge
 
Delphi 2007 Professional
 
#8

Re: Brauche dringend Hilfe zu Tobit DvISE Programmierung

  Alt 7. Apr 2008, 01:04
Ich habe jetzt mit dem Namen "FaxItems" in der TLB.pas gesucht.
Man findest, dass dieses Property ein Inteface namens "MessageItems" zurückliefert.
Delphi-Quellcode:
  MessageItems = interface(IDispatch)
    ['{2A2E9B58-B2F9-49DA-B302-DC0402376CEB}']
    function Item(vIndex: OleVariant): MessageItem; safecall; // <==
    function Get__NewEnum: IUnknown; safecall;
    function Get_Count: Integer; safecall;
    function Get_Parent: IDispatch; safecall;
    function Get_Account: Account; safecall;
    property _NewEnum: IUnknown read Get__NewEnum;
    property Count: Integer read Get_Count;
    property Parent: IDispatch read Get_Parent;
    property Account: Account read Get_Account;
  end;
Es wird also ein Objekt "MessageItem" aus der Liste geliefert.
Es wird aber auch das Interface "FaxItem" untersützt:
Delphi-Quellcode:
  FaxItem = interface(MessageItem)
    ['{20F310C8-AD57-4F8C-AE04-15233E09F95B}']
    function Get_To_: WideString; safecall;
    function Get_PageCount: Integer; safecall;
    function Get_Image: OleVariant; safecall;
    function Get_Fields: IDispatch; safecall;
    procedure Copy(const pArchive: Archive); safecall;
    procedure Move(const pArchive: Archive); safecall;
    property To_: WideString read Get_To_;
    property PageCount: Integer read Get_PageCount;
    property Image: OleVariant read Get_Image;
    property Fields: IDispatch read Get_Fields; // <==
  end;
Und dort finden wir auch das Property "Fields". Es hat den Typ IDispatch, kann aber auch in folgendes Interface verwandelt werden:
Delphi-Quellcode:
  Fields = interface(IDispatch)
    ['{2B059336-EE52-4273-B79A-6FC1AE82A896}']
    function Item(vIndex: OleVariant): Field; safecall;
    function Get__NewEnum: IUnknown; safecall;
    function Get_Count: Integer; safecall;
    function Get_Parent: IDispatch; safecall;
    function Get_Account: Account; safecall;
    function GetText(ID: Integer): WideString; safecall;
    function Get_UserFields: IUserFields; safecall;
    property _NewEnum: IUnknown read Get__NewEnum;
    property Count: Integer read Get_Count;
    property Parent: IDispatch read Get_Parent;
    property Account: Account read Get_Account;
    property UserFields: IUserFields read Get_UserFields;
  end;
Damit sähe dein Code so aus:
Delphi-Quellcode:
var
   felder : Fields;
begin
...
for m := 0 to oMessageItems.Count-1 do begin
   oFaxItem := oMessageItems.Item(m) as FaxItem;

   felder := oFaxItem.Fields as Fields;

   AbsenderFax := felder.Item('SRFROM');
end;
  Mit Zitat antworten Zitat