title: c++ IntelliSense: expression must be a modifiable lvalue
body: <p>im getting these two errors  </p>
  
  <pre><code>1&gt;c:\users\owner\documents\visual studio 2010\projects\monopoly\monopoly\xfileentity.cpp(376): error C3490: 'pDrawMesh' cannot be modified because it is being accessed through a const object
  IntelliSense: expression must be a modifiable lvalue
  </code></pre>
  
  <p>i declared pDrawMesh in my class than used it in one function.<br>
  here is my class</p>
  
  <pre><code>class CXFileEntity
  {
          ......
   LPD3DXMESH pDrawMesh;
          .....
  };
  </code></pre>
  
  <p>here is where i used the variable </p>
  
  <pre><code>void CXFileEntity::DrawMeshContainer(LPD3DXMESHCONTAINER meshContainerBase, LPD3DXFRAME frameBase) const
  {
   // Cast to our extended frame type
   D3DXFRAME_EXTENDED *frame = (D3DXFRAME_EXTENDED*)frameBase;  
  
   // Cast to our extended mesh container
   D3DXMESHCONTAINER_EXTENDED *meshContainer = (D3DXMESHCONTAINER_EXTENDED*)meshContainerBase;
  
   // Set the world transform But only if it is not a skinned mesh. 
   // The skinned mesh has the transform built in (the vertices are already transformed into world space) so we set identity
   // Added 24/08/10
   if (meshContainer-&gt;pSkinInfo)
   {
    D3DXMATRIX mat;
    D3DXMatrixIdentity(&amp;mat);
    m_d3dDevice-&gt;SetTransform(D3DTS_WORLD, &amp;mat);
   }
   else
    m_d3dDevice-&gt;SetTransform(D3DTS_WORLD, &amp;frame-&gt;exCombinedTransformationMatrix);
  
  
   // Loop through all the materials in the mesh rendering each subset
   for (unsigned int iMaterial = 0; iMaterial &lt; meshContainer-&gt;NumMaterials; iMaterial++)
   {
    // use the material in our extended data rather than the one in meshContainer-&gt;pMaterials[iMaterial].MatD3D
    m_d3dDevice-&gt;SetMaterial( &amp;meshContainer-&gt;exMaterials[iMaterial] );
    m_d3dDevice-&gt;SetTexture( 0, meshContainer-&gt;exTextures[iMaterial] );
  
    // Select the mesh to draw, if there is skin then use the skinned mesh else the normal one
    pDrawMesh = (meshContainer-&gt;pSkinInfo) ? meshContainer-&gt;exSkinMesh: meshContainer-&gt;MeshData.pMesh;
  
    // Finally Call the mesh draw function
    pDrawMesh-&gt;DrawSubset(iMaterial);
   }
  }
  </code></pre>