title: Passing by refference from C++\CLI to C++
body: <p>I have a C++\CLI wrapper to a C++ API of a commercial program.
  A certain wrapper function looks like this:</p>
  
  <pre><code>int ReleaseObject(WDataObject^ object) {
      return (m_api-&gt;ReleaseObject(object-&gt;m_object));
  };
  </code></pre>
  
  <p>On the previous version of the API, the C++ side was:</p>
  
  <pre><code>m_api-&gt;ReleaseObject(const api:DataObject *object)
  </code></pre>
  
  <p>And in the current API version the function has changed to:</p>
  
  <pre><code>m_api-&gt;ReleaseObject(const api:DataObject *&amp;object)
  </code></pre>
  
  <p>My knowledge on C++\CLI is none and my C++ knowledge is very basic, and I have no clue on how to modify the wrapper function to make it compile.</p>
  
  <p>I'd like to know how to modify the wrapper c++\CLI function to pass the object by reference according to what the C++ API expects.</p>
  
  <p>EDIT:</p>
  
  <p>Error when compiling:</p>
  
  <pre><code>Error   3   error C2664: 'int api::Api::ReleaseObject(api::DataObject *&amp;)' : cannot convert argument 1 from 'api::DataObject *' to 'api::DataObject *&amp;' ...\pf_api_test - 15.2.2\libs\digapiwrapper15.1_64bit\digApiWrapper.h   851 1   digApiWrapper
  </code></pre>
  
  <p>EDIT 2:</p>
  
  <pre><code>    [SerializableAttribute]
          public ref class WDataObject {
              public:
  
              api::DataObject* m_object;
  
              WApi^ t_api;
  
              String^  Name;
              int  Class;
              String^ key;
  
              WDataObject(api::DataObject* obj) { m_object = obj; };
  
              ~WDataObject();
  
   /*HERE GOES ALL THE FUNCTIONS WHICH I'M NOT SURE IF THEY ARE RELEVANT*/
      }
  </code></pre>