AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Win32/Win64 API (native code) Delphi zugriff auf array einer function in Typelibrary
Thema durchsuchen
Ansicht
Themen-Optionen

zugriff auf array einer function in Typelibrary

Ein Thema von th_bone · begonnen am 14. Jan 2005 · letzter Beitrag vom 18. Jan 2005
 
th_bone

Registriert seit: 16. Jun 2004
172 Beiträge
 
Delphi 2005 Professional
 
#3

Re: zugriff auf array einer function in Typelibrary

  Alt 18. Jan 2005, 20:09
Hallo,

zur Hilfe für andere, die dieses Problem haben hier die funktionierende Lösung die ich unter tatkräfiger mithilfe von Andreas Kosch (Autor - DCOM/Com mit Delphi) gefunden habe:

Das Hauptproblem für mich war, dass das psavearray kein array sondern nur einen Zeiger auf das eigentliche Array enthält

Delphi-Quellcode:
procedure TForm1.Button4Click(Sender: TObject);
var
  pSA : PSafeArray;
  i : Integer;
  swValue : single;
  iDim : Integer;
  iLBound : Integer;
  iUBound : Integer;
begin
  pSA := nil;

 // Verbindung zur Typbibliothek
 iquotes:= coMLquotes.Create; // 2. coclasse definieren
 iquotes.DownloadQuotes('SUNW',20041013,20050114,d);
 // PSaveArray Zeiger holen
 iquotes.Get_adOpen(pSa);

  iDim := SafeArrayGetDim(pSA);
  if iDim = 1 then
    begin
    SafeArrayGetLBound(pSA, 1, iLBound);
    SafeArrayGetUBound(pSA, 1, iUBound);
    for i := iLBound to iUBound do
    begin
      SafeArrayGetElement(pSA, i, swValue);
      ListBox1.Items.Add(floattostrf(swValue,fffixed,4,2));
    end;
    ListBox1.Items.Add('------------');
  end;
  SafeArrayDestroy(pSA);
end;
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 18:55 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz