Dynamic memory allocation from dll
Hi,
I have a C++ DLL. This DLL contains a function func ( float **arg1, int &nbArg1, int **arg2, int &nbArg2 ); This function do dynamic memory allocation to allocate enough of memory for arg1 and arg2. I'm looking for a way to call this function in a C## program and be able to access data in arg1 and arg2.
Thank you
Re: Dynamic memory allocation from dll
You'll need to use pointers in unsafe mode. This link should be illuminating: http://msdn.microsoft.com/en-us/libr...=vs.71%29.aspx
Re: Dynamic memory allocation from dll
Quote:
Originally Posted by
BioPhysEngr
Thank you for your information. I have finally found a walk around by adding function in the dll that can return size of returned structures. In this way I preallocate arrays. This walk around works in the current situation because I have control on both C++ dll and C## code.