title: Why can't I use SetArgPointee() with googlemock?
body: <p>I am trying to set an "out" parameter on a mock with <code>SetArgPointee</code>.  Here's the code I'm testing:</p>
  
  <pre><code>DWORD bodysize = 1024;
  char body[1024];
  HRESULT hr = req-&gt;ReadEntityBody(body, bodysize, false, &amp;bodysize, NULL);
  </code></pre>
  
  <p><code>req</code> is an <a href="http://msdn.microsoft.com/en-us/library/ms694263%28v=vs.90%29.aspx" rel="noreferrer">IHttpRequest*</a>, and I want to set <code>bodysize</code>, argument 3, in the mock.  Here's the code from my unit test:</p>
  
  <pre><code>EXPECT_CALL(req, ReadEntityBody(NotNull(), Ge(1024), false, NotNull(), _))
      .WillOnce(SetArgPointee&lt;3&gt;(4))
      .WillOnce(Return(ERROR_HANDLE_EOF));
  </code></pre>
  
  <p>This results in the following strange error:</p>
  
  <blockquote>
    <p>error C2440: 'return' : cannot convert from 'void' to 'long' (gmock/gmock-actions.h:369)</p>
  </blockquote>
  
  <p>If I comment out <code>.WillOnce(SetArgPointee&lt;3&gt;(4))</code>, the code compiles and executes correctly.  Here is the relevant definition in the mock itself:</p>
  
  <pre><code>MOCK_METHOD5(ReadEntityBody, HRESULT(VOID *pvBuffer, DWORD cbBuffer, BOOL fAsync, DWORD *pcbBytesReceived, BOOL *pfCompletionPending));
  </code></pre>
  
  <p>And, in case it helps, my <a href="http://pastebin.ubuntu.com/6010824/" rel="noreferrer">full mock of IHttpRequest</a>.</p>