SafeArrayPutElement delphi

0

I have a rather big problem. I have a C # DLL with some props that are arrays string[] teste; and generate the TLB. When importing to Delphi 2007 the TLB. The "test" array goes as PSafeArray .

How do I make this array popular through delphi?

I already create the array, determine the size. However, when filling in the information I want, it does not fill, leave the position in the empty array. Does anyone know how to explain what I'm missing?

Here is a snippet of code, where " dados.PreencheDados " is a C # function to display dados.teste[x] :

Bounds[0].lLbound := 0;
Bounds[0].cElements := 1;
x := 0;
dados.teste := SafeArrayCreate(varOleStr,1,Bounds);
SafeArrayPutElement(dados.teste,x, 'Testando');
dados.PreencheDados;

I managed to get it to work last week, however, I deleted the code that worked and now it's blank and I can not get it anymore. I hope someone helps me.

    
asked by anonymous 12.12.2016 / 19:57

0 answers