title: Typecasting from struct to LPVOID
body: <p>Worked fine before I threw it into a class. Any help for resolving this typecasting error?</p>
  
  <p><strong>Error</strong></p>
  
  <pre><code>error C2440: 'type cast' : cannot convert from 'IAT CInjector::* ' to 'LPVOID'
  </code></pre>
  
  <p><strong>Code Referenced</strong></p>
  
  <pre><code>WriteProcessMemory(CInjector::_hProc, 
      CInjector::_iatBaseAddress, 
      (LPVOID) &amp; CInjector::_iat, // typecasting error?
      sizeof (IAT), 
      NULL);
  </code></pre>
  
  <p><strong>Class</strong></p>
  
  <pre><code>class CInjector
  {
  private:
      ...
      IAT _iat;
      ...
  }
  </code></pre>
  
  <p><strong>Typedef</strong></p>
  
  <pre><code>typedef struct _IAT {
      PLOADLIBRARYA pLoadLibraryA;
      PGETPROCADDRESS pGetProcAddress;
      FNMESSAGEBOX fnMessageBox;
  } IAT;
  </code></pre>