Safearray, SafeArrayGetElement function

B

benk

Hello

I have create a Safearray of integer in Delphi,

ArrayBounds[0].lLbound := 0;
ArrayBounds[0].cElements := 1;
pArray := SafeArrayCreate(varVariant, 1, ArrayBounds);
if SafeArrayAccessData(pArray, ArrayData) = S_OK then
begin
OleString := 'Teststring';
SafeArrayPutElement(pArray, ArrayBounds, OleString);
SafeArrayUnAccessData(pArray);
end;

whene I wante to get this element from the safe array with the
SafeArrayGetElement function

getResult := SafeArrayGetElement(arr, Index, outString);
str := outString;
outString is empty (it not contain the 'Teststring')

Help me please
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

DropMany 2
DropMany method 0
my latest C++ excel OLE automation code 4

Top