Sign in to follow this  

Mesh.CreateText fails with E_INVALIDARG. Mesh.CreateSphere works. (SOLVED)

This topic is 2056 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Long story short I'm trying to create a mesh object for a string using Mesh.CreateText() but it is failing with "E_INVALIDARG: An invalid parameter was passed to the returning function (-2147024809)". I am getting proper behavior with Mesh.CreateSphere(), etc. and can even display the resultant mesh so I don't think it's an issue with how I'm using SlimDX directly.

More details about my setup:
Win7 x64.
VS 2010 Ultimate.
.NET 4.0 app compiling/running as x86.
Jan 2012 version of SlimDX (x86 version referenced).
WPF app using the D3D9 SlimDX WPF host sample.

My exact method call (it doesn't matter where I call this, same result):
var f = System.Drawing.SystemFonts.DefaultFont;
var m = Mesh.CreateText(Device, f, "foo", 0.0f, 0.0f); // different deviation/extrusion values don't work, either

Enabling the Debug D3D9 runtime only shows the first chance Direct3D9Exception getting thrown and I looked through the output of PIX but didn't see anything that caught my eye.

I'm not very familiar with D3D and I'm sure I'm lacking some helpful information, but I'll be happy to add any required details.

Edit: Updating title to indicate problem solved. See conversation below for the solution.

Share this post


Link to post
Share on other sites
Even after you've enabled the debug runtimes, you need to enable "unmanaged debugging" from within the VS IDE in order to see output messages. Have you done that? E_INVALIDARG is almost always an indicator that there's some other information to be had.

Share this post


Link to post
Share on other sites
I have native debugging enabled both for my executable and for the assembly that contains my 3D code but still nothing. I've attached the complete contents of my debug window if it helps. The call to Mesh.CreateText() only added the final line to the output window.

Share this post


Link to post
Share on other sites
Are you by any chance using Direct3D9Ex instead of the traditional version? There are a few sources that seem to indicate that this particular function might be broken under Ex.

Share this post


Link to post
Share on other sites
Indeed I was using Direct3D9Ex instead of the regular one. Forcing the regular one to be used has fixed my problem, thank you!

Share this post


Link to post
Share on other sites
Sign in to follow this