I have a native library with some native ntype
in it and would like to p/invoke some functions in it.
I was able to marshal for:
foo1(ntype** p) ==> foo1(IntPtr[] p)
But don't know how to do it for:
foo1(ntype*[] p) ==> foo1(<???> p)
At least IntPtr[]
did not worked.
Edit
The unmanaged function I'm trying to marshal with is:
extern mxArray* mclCreateSimpleFunctionHandle(mxFunctionPtr fcn);
where mxFunctionPtr
is:
typedef void(*mxFunctionPtr)(int nlhs, mxArray *plhs[], int nrhs, mxArray *prhs[]);
This represent a call to the following matlab function signature:
function [varargout] = callback(varargins)
%[
%% Do callback code %%
%]
Obviously, from my expectations, this function pointer should provide me with 2 lists of mxArray*
:
- The list of input arguments (i.e. prhs, initialized on matlab's side)
- The list of output arguments (i.e. plhs, all initialized to zero but in which I should write into)
Currently from the tests I've made, it only returns for firsts mxArray*
in plhs
and prhs
lists