   [MDX] Effect.FromFile problem
  I seem to have a strange problem with the following code: Effect effect;   public MeshMaterial(Device device, string filename)   {  try  { effect = Effect.FromFile(device, filename, null, null, ShaderFlags.None, null);  }  catch (Exception)  { System.Windows.Forms.MessageBox.Show("caught exception");  }   } If I use the correct device and the correct filename, the function works and the program exits with no memory leaks.If I use the correct device but an incorrect filename, I get the exception and when I exit the program there is a memory leak.If I use a null device and incorrect filename I get the exception and the program exits with no memory leaks.I can't figure out why Effect.FromFile appears to be causing a memory leak if it fails. Anyone have any explanations?   
  I can only offer a guess, but you could use the reflector tool to check out the source code of the MDX assemblies for more information. Anyway, MDX obviously seems to allocate some resource(s) for the effect, even before it's actually loaded. This would explain why there is no memory leak with an invalid device, since it just cannot allocate those resources. Additionally, the error you get from loading an effect from an invalid source should tell you the effect is invalid IIRC. So somehow it seems to be trying to compile the effect, no matter whether if it could actually be loaded or not.As for how or why this is, I honestly wouldn't know [smile]   ;  Thanks for the advice, the reflector tool is not something I have ever used before. Maybe I should take a look though.Anyway I managed to sort it out by uninstalling the February06 SDK and installing the April SDK. There is now a first chance exception of Microsoft.DirectX.Direct3D.InvalidDataException that happens. I don't think it happened before, but I could be wrong because I wasn't looking for it.   