Einzelnen Beitrag anzeigen

Benutzerbild von Aya
Aya

Registriert seit: 24. Jul 2003
Ort: Kassel
138 Beiträge
 
Delphi 6 Professional
 
#1

Array Parameter in einer DLL

  Alt 22. Jul 2006, 22:04
Hi,

ich bastle gerade eine DLL in VC++ und binde die in Delphi ein. Klappt soweit alles ganz gut..

Nur, jetzt muß ich einen Array von Delphi an die DLL übergeben, in dieser DLL soll der Array gefüllt werden und wieder zurück zu Delphi..

Wie mach ich das?

Code:
void myFunction(float *output);
{
  for (int i = 0; i < 10; i++)
    output[i] = 5.0f;
}
Delphi-Quellcode:
TFloatArray = Array of Single;

procedure myFunction(var outPixels: TFloatArray); stdcall; external DLLName;

[...]
var
  output: TFloatArray;
begin
  SetLength(output, 100);
  myFunction(output);
So geht es leider nicht.. bekomme ne AccessViolation.

Hat jemand ne idee wie das geht??

Au'revoir,
Aya~
I aim for my endless dreams and I know they will come true!
S: String = #86^)^3^)^4#58#32^(^4^4^0#58#47#47^7^7^7#46^+^/^3^(^)^'^!^9^!#46^$^%;
  Mit Zitat antworten Zitat