Einzelnen Beitrag anzeigen

TiGü

Registriert seit: 6. Apr 2011
Ort: Berlin
3.060 Beiträge
 
Delphi 10.4 Sydney
 
#4

AW: SafeArray of record

  Alt 14. Jan 2019, 09:15
Oh, ich nahm an, du willst ein Array mit Interface-Instanzen übergeben.
Du willst also stattdessen ein Array mit deinen Record namens TRecSample übergeben?
Schauen wir uns dazu nochmal die Doku an:

Zitat:
pvExtra

the type information of the user-defined type, if you are creating a safe array of user-defined types. If the vt parameter is VT_RECORD, then pvExtra will be a pointer to an IRecordInfo describing the record. If the vt parameter is VT_DISPATCH or VT_UNKNOWN, then pvExtra will contain a pointer to a GUID representing the type of interface being passed to the array.
Ich nehme an, du hat als ersten Parameter den Wert VT_RECORD und nicht VT_DISPATCH or VT_UNKNOWN, richtig?
Dann musst du eine Instanz einer Klasse übergeben, welche IRecordInfo implementiert.
Hier ein bisschen zum Nachlesen:
https://stackoverflow.com/questions/...ype-to-vb6-dll
  Mit Zitat antworten Zitat