Sign in to follow this  
maorc

[SlimDX] Direct3DX9NotFoundException is thrown

Recommended Posts

Hello, I'm a part of the development team of Visions, a 3D Image Management System. (The application can be downloaded from here: http://www.twins-solutions.com) We are using SlimDX in our app. Some of our customers (approximately 5% of them) are getting the Direct3DX9NotFoundException exception when starting the application. The problem is that our installer uses DirectX web setup (by Microsoft) to update DirectX to the latest version and even if we ask them to do a manual install (either using the web setup or download the full DirectX package) they get this exception. The web setup informs the user that DirectX is already installed. We searched through the internet for a solution but couldn't get anything. Can you help? Thanks, Maor Cohen Twins Solutions

Share this post


Link to post
Share on other sites
You need to include the DirectX redistributable package (Or get them to download it) that comes with your SDK version. The web installer only installs D3D, not D3DX the latest version of D3D and D3DX, not every version.

The November 2007 redist is here.

Share this post


Link to post
Share on other sites
I'm not sure whether it'd be possible on a non-dev environment, but have you considered using the fusion log viewer to see which DLL's it's trying to pull in? Maybe use Process Monitor from sysinternals to monitor LoadLibrary/ReadFile events. Again, not exactly simple for an end-user but you may well find that its the best source of information.

You may find that through some obscure oversight on your part its not looking for DLL's in the right place and that the web installer is in fact installing the latest-n-greatest D3DX version. Or maybe it isn't - but the aforementioned tools should tell you what its looking for and you can then start to figure out why it can't find it...


hth
Jack

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
The web installer only installs D3D, not D3DX the latest version of D3D and D3DX, not every version.
[lol]I was just about to call you on your original post! But I must admit I missed the small print on it being only the latest and not every D3DX...


Anyway, maorc, you can probably ignore my overly complex suggestions and just package up your dependencies and installer correctly instead. That should sort everything out [smile]


cheers,
Jack

Share this post


Link to post
Share on other sites
Thank you both for the quick and detailed replies.

As I said in my post, I already asked my customers to use the full DirectX installation package (the redistributable version), that didn't help.

When I asked one of my users to export a report using dxdiag.exe I found out that some of the files are not updated to the latest (unlike on my computer for example) even though he used the redist package.

Asking my customer to use file/process monitor is too complex. I must find the problem myself...

The question is where should I look for the problem, in Microsoft's DirectX installation or in SlimDX "D3DXCheckVersion" method (which is actually the method that throws the exception). I do hope that the problem is with SlimDX. It would be quicker to fix... ;)

Share this post


Link to post
Share on other sites
The SlimDX code doesn't actually check the result of D3DXCheckVersion; it's just calling it to force the DLL to load at that point, and looking for an SEHException (indicating that the delay load failed to resolve). You should be able to use dependency walker to look up the exact name of the DLL it expects, and that DLL ought to be present in the user's WINDOWS_ROOT\system32 directory. If that DLL is present on the system and SlimDX is still throwing that exception, then something is definitely wrong with SlimDX...otherwise, it would probably be an MS bug.

Share this post


Link to post
Share on other sites
Thanks promit,

I downloaded the utility and launched it on my computer for the SlimDX library. The following DirectX libraries are shown as a dependency:

D3D10.DLL
D3D10CORE.DLL
D3D8THK.DLL
D3D9.DLL
D3DX10_38.DLL
D3DX9_38.DLL

I have no problem on my computer and SlimDX is working just fine. But still, is it OK that the dependency is D3DX9_38.DLL? shouldn't it be D3DX9.DLL?

Anyway, I asked my customer to do the same as I did and I will give his result soon.

Maor

Share this post


Link to post
Share on other sites
Quote:
Original post by maorc
I have no problem on my computer and SlimDX is working just fine. But still, is it OK that the dependency is D3DX9_38.DLL? shouldn't it be D3DX9.DLL?
For the last few years all releases of D3DX have had an incrementing number attached to them. Whichever SDK your build of SlimDX was built with contained this particular version and hence you've got a dependency on it.

hth
Jack

Share this post


Link to post
Share on other sites
Quote:
Original post by maorc
OK. So when updating DirectX to the latest version (using web setup or redist package) this file should definitely be there, right?
As far as I remember, the web package installs the latest version of DirectX and the latest version of the D3DX library, and the redist package installs the latest version of DirectX and every version of the D3DX library. You should have the redist run as part of your installer (I'm not really sure of the details here, Jack or someone else may be able to give better advice), so it installs the files you need.

You could verify this by trying to use LoadLibrary() (Or C# equivalent) near the time your app starts, and if that fails you know the D3DX DLL isn't installed.

Share this post


Link to post
Share on other sites
If you remember, I already asked my customer to use the redist package and that didn't help. The redist package notified that no update is needed...
I don't believe the issue here is the web setup, as it is working just fine for 95% of the clients.
Anyway, our installation is about 10MB. Adding the redist package will add 60MB (as much as I remember) to the installation, situation we can't allow...

I hope to get a response from the user that had the problem. I asked him to validate the existence of the dependency dlls (using the "Dependency Walker" utility). As soon as I get a response, I will post it here.

I forgot to mention something. A few months ago, I had a customer with the same problem. I asked him to install DirectX using web setup and even using the redist package. Then I asked him to export a summary from the dxdiag utility. When I compared his files and mine, I noticed that some of his files were OLDER than on my computer. Meaning the DirectX installer didn't update some of the files. Is there a reasonable explanation for this?

Share this post


Link to post
Share on other sites
Hey Mike,

I asked some of them to send a summary from the dxdiag utility. I couldn't find anything special about their configuration, except the differences in the file versions that I already mentioned.

My first thought was that it is a bug in the installer of DX, but I was hoping that it is something else, since getting Microsoft to fix it can be quite hard...

Share this post


Link to post
Share on other sites
Update:

The problem is finally solved.

However, we are not sure what managed to solve it.
We asked the user to install the June 2008 Redistributable Package of DirectX, but before he did that he installed some computer game (which probably installed the redist package) and Visions then worked perfectly.

I don't know why exactly Microsoft differentiates the web and redist packages, but we simply can't supply a 74MB package with a 10MB product. So we'll have to supply a link to the redist package as a solution.

Anyway, thank you all for the great support.

Maor

Share this post


Link to post
Share on other sites
I've got the exact same error, and the dependency walker shows I'm missing D3DX9_39.DLL. That's fixable. However, I installed SlimDX using the installed from googlecode page, and I thought that would include all dependencies. If I want to distribute anything, what do I need to include? My app, SlimDX installer + ?

Share this post


Link to post
Share on other sites
Basically, to run a SlimDX application right now you need
1) The SlimDX DLL, which can either be copied into the same directory or installed into the GAC.
2) The VC runtimes (this dependency will probably be going away in the next release)
3) The latest DirectX runtime (the SlimDX September release needs the August runtime).

Share this post


Link to post
Share on other sites
In my somewhat old version of the SDK the redist license (in the \Documentation\License Agreements folder) says that the redist only needs to contain a handful of the files that are in the full redist. Specifically: DSetup32.dll, DSetup.dll, DXSetup.exe, DXupdate.cab and dxdllreg_x86.cab. That's under 3MB in total. Obviously you'll want to add in the appropriate cab for D3D (~13MB) and the D3DX version that you require (~2MB).

See http://msdn.microsoft.com/en-us/library/bb174600(VS.85).aspx for details.

Share this post


Link to post
Share on other sites
Quote:
Original post by Adam_42
In my somewhat old version of the SDK the redist license (in the \Documentation\License Agreements folder) says that the redist only needs to contain a handful of the files that are in the full redist. Specifically: DSetup32.dll, DSetup.dll, DXSetup.exe, DXupdate.cab and dxdllreg_x86.cab. That's under 3MB in total. Obviously you'll want to add in the appropriate cab for D3D (~13MB) and the D3DX version that you require (~2MB).
This is what we do for the SlimDX installer, as well as RAR compressing the whole thing. It ends up being around 5 MB of the installer, I think. Maybe 6.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this