title: cannot convert parameter 2 from 'mxArray **' to 'mwArray &'
body: <p>I want to create a C++ Shared library from Matlab using deloytool and use it in MVS. I compile a function name 'foo.m', as the result I got list of files (.h,.cpp,.lib,...) and I found the function in 'fooCpplib.h' is as follow:</p>
  
  <pre><code>extern LIB_fooCpplib_CPP_API void MW_CALL_CONV foo(int nargout, mwArray&amp; y, const mwArray&amp; x);
  </code></pre>
  
  <p>Then I create a MVS project (2010), window form application, with 2 textbox and 2 click button, one textbox named inBox, and another named outBox. The code inside button_click is as follow:</p>
  
  <pre><code>private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
  double input = System::Double::Parse(inBox-&gt;Text);
  mxArray *x_ptr;
  mxArray *y_ptr=NULL;
  double *y;
  
  // Create an mxArray to input into mlfFoo
  x_ptr = mxCreateDoubleScalar(input);
  
  // Call the implementation function 
  // Note the second input argument should be &amp;y_ptr instead of y_ptr. 
  foo(1,&amp;y_ptr,x_ptr);
  
  // The return value from mlfFoo is an mxArray. 
  // Use mxGetpr to get a pointer to data it contains.
  y = (double*)mxGetPr(y_ptr);
  
  // display the result in the form
  outBox-&gt;Text = ""+*y;
  
  //clean up memory
  mxDestroyArray(x_ptr);
  mxDestroyArray(y_ptr);
  }
  </code></pre>
  
  <p>When I build the project, the error was occurred as below:</p>
  
  <pre><code>error C2664: 'foo' : cannot convert parameter 2 from 'mxArray **' to 'mwArray &amp;'
  Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style
  cast.
  </code></pre>
  
  <p>Note: I already included 'fooCpplib.h' in the .cpp source file.</p>
  
  <p>Could anyone help me about this!
  Thank you!</p>