Hello I am using VS2005 and MDX December 2005. Suppose that I have this code to generate a mesh of a square:
mesh = new Mesh(device, 2, 4, MeshFlags.Managed, PositionNormalTextured.Format);
GraphicsBuffer<PositionNormalTextured> vertBuffer = mesh.LockVertexBuffer<PositionNormalTextured>(LockFlags.None);
int i = 0;
PositionNormalTextured[] verts = new PositionNormalTextured[4];
verts[i++] = new PositionNormalTextured(0, 0, 0, 0, 0, 1, 0, 0);
verts[i++] = new PositionNormalTextured(1, 0, 0, 0, 0, 1, 1, 0);
verts[i++] = new PositionNormalTextured(0, 1, 0, 0, 0, 1, 0, 1);
verts[i++] = new PositionNormalTextured(1, 1, 0, 0, 0, 1, 1, 1);
vertBuffer.Write(verts);
mesh.UnlockVertexBuffer();
A similar version of this code worked just fine in previous versions of MDX. But now when i check vertBuffer.NumberElements it always returns 0 (for any mesh not just this one). Though mesh.NumberVertices does return a correct number.
Later I need to modify this mesh:
vertBuffer = mesh.LockVertexBuffer<PositionNormalTextured>(LockFlags.None);
verts = vertBuffer.ReadArray(mesh.NumberVertices);
vertBuffer.Write(verts);
mesh.UnlockVertexBuffer();
But I get a security exception. Am I doing something wrong or its a bug

new GraphicsBuffer problems
Laird_McSQL
Sharp&#33;
When I try to submit feedback on the site I always get
Error: One or more of the form fields contained invalid data.
I checked everything.
ZoltanK
Sounds like a bug if it used to work....
David has asked for all the beta feedback to go to the beta newsgroup. Join through here http://msdn.microsoft.com/directx/beta/ then look for news:microsoft.beta.mdx.misc
ttx3