I need to create a list (array) from .net which consists of about 50 000 elements, pass it to c++ dll, operate on it and return a list (array) from c++ to .net.
- First option which comes to my mind, is to create a struct on both sides. Return an array of structs from .net to c++.
Here are my concerns:
a) if in a struct, it consists non reference types like: ints, doubles, etc will an array of structs with its values will be stored on stack?
Is there a limit when creating array of struct? Is it efficient?
Is it an efficient way to initialize such a large array on .net side?
- Do you have any sample which shows how to pass references to objects, etc? Without COM, interoperability, etc?
Generally I seek an advise how to perform efficiently the following things:
1) Fetch data from db 2) Allocate it in a structure which I could efficiently pass to a dll c++ win32 library 3) Perform operations on c++ side, then return an array back to .net
I also need an advise, on which side the objects should be allocated/deallocated in terms of performing the above operations..
Thanks for help in advance
P.S. I also don't understand the info that making an array public in a class, makes a whole copy every time I access it ... Could someone explain that to me?