H
hml
Hi,
I have a "legacy" system (namely, vst audio plugins) which calls me through a mixed-mode, managed c++ library with a call similar to :
void process(float *input,int inputLength)
inside this method, I'm trying to find a way to instanciate a managed array (System.Single[]), which would map exactly to the portion of memory pointed by input, with a call like :
IntPtr pointer(&input[0]);
float myManagedArray[] = CreateArray(pointer,inputLength);
This would allow me to call a c# class from there, with the newly created array as parameter, fully managed, at low cost (no copy, realloc etc), and without having to go "unsafe" in the c# method (I'd like to avoid that).
Is there a way to do that ?
Any idea welcome, I'm using unsafe pointers to do that for the moment.
___
Newsgroups brought to you courtesy of www.dotnetjohn.com
I have a "legacy" system (namely, vst audio plugins) which calls me through a mixed-mode, managed c++ library with a call similar to :
void process(float *input,int inputLength)
inside this method, I'm trying to find a way to instanciate a managed array (System.Single[]), which would map exactly to the portion of memory pointed by input, with a call like :
IntPtr pointer(&input[0]);
float myManagedArray[] = CreateArray(pointer,inputLength);
This would allow me to call a c# class from there, with the newly created array as parameter, fully managed, at low cost (no copy, realloc etc), and without having to go "unsafe" in the c# method (I'd like to avoid that).
Is there a way to do that ?
Any idea welcome, I'm using unsafe pointers to do that for the moment.
___
Newsgroups brought to you courtesy of www.dotnetjohn.com