title: C#: Pointer to the struct inside the struct
body: <p>I am trying to use marshalling in C#.  In C++ I have a this struct:</p>
  
  <pre><code>struct aiScene
  {
      unsigned int mFlags;
      C_STRUCT aiNode* mRootNode;
      unsigned int mNumMeshes;
      C_STRUCT aiMesh** mMeshes;
      unsigned int mNumMaterials;
      C_STRUCT aiMaterial** mMaterials;
      unsigned int mNumAnimations; 
      C_STRUCT aiAnimation** mAnimations;
      unsigned int mNumTextures;
      C_STRUCT aiTexture** mTextures;
      unsigned int mNumLights;
      C_STRUCT aiLight** mLights;
      unsigned int mNumCameras;
      C_STRUCT aiCamera** mCameras;
  }
  </code></pre>
  
  <p>So, C# eqvivalent is:</p>
  
  <pre><code>[StructLayout(LayoutKind.Sequential)]
  public struct aiScene
  {
      public uint mFlags;
      public unsafe aiNode* mRootNode;
      public uint mNumMeshes;
      public unsafe aiMesh** mMeshes;
      public uint mNumMaterials;
      public unsafe aiMaterial** mMaterials;
      public uint mNumAnimations;
      public unsafe aiAnimation** mAnimations;
      public uint mNumTextures;
      public unsafe aiTexture** mTextures;
      public uint mNumLights;
      public unsafe aiLight** mLights;
      public uint mNumCameras;
      public unsafe aiCamera** mCameras;
  }
  </code></pre>
  
  <p>But many on this structs are managed ( aiNode, aiMesh, aiLight ) etc.  So, I have this error: </p>
  
  <blockquote>
    <p>Cannot take the address of, get the
    size of, or declare a pointer to a
    managed type ('Assimp.aiNode')</p>
  </blockquote>
  
  <p>Any ideas on how to solve this issue?</p>