title: C++ Modifying struct passed to function as a pointer
body: <p>I have the following struct:</p>
  
  <pre><code>typedef struct _wfs_result
  {
      REQUESTID       RequestID;
      HSERVICE        hService;
      SYSTEMTIME      tsTimestamp;
      HRESULT         hResult;
      union {
          DWORD       dwCommandCode;
          DWORD       dwEventID;
      } u;
      LPVOID          lpBuffer;
  } WFSRESULT, * LPWFSRESULT;
  </code></pre>
  
  <p>A pointer to the struct is passed to this function:</p>
  
  <pre><code>int DLL_EXPORT WFSGetInfo ( HSERVICE hService, DWORD dwCategory, LPVOID
  lpQueryDetails, DWORD dwTimeOut, LPWFSRESULT * lppResult)
  </code></pre>
  
  <p>However, when I try to modify the struct inside the function, it won't let me (doesn't compile)
  This is how I tried to access it inside the function:</p>
  
  <pre><code>lppResult-&gt;RequestID = 123;
  or
  (*lppResult).RequestID = 123;
  </code></pre>
  
  <p>The second one compiles, but I get access violation in the debugger.
  Any thoughts?</p>
  
  <p>EDIT:
  This is the error I get in Codeblocks:</p>
  
  <pre><code>'RequestID' in 'lppResult', which is of non-class type '_wfs_result**'|
  ||=== Build failed: 1 error(s), 2 warning(s) (0 minute(s), 0 second(s)) ===|
  </code></pre>