DirectX application on 64 bit windows
Asked Answered
C

2

6

I am developing a WPF application where the 3D part is handled by DirectX 9 (a lot of 3d that did not run fast enough using WPF).

The problem is the application is released with "Any CPU" as configuration and when a user runs it on a 64 bit windows, the direcX part crashes (System.BadImageFormatException). Apparently the dlls included for the directX part is not usable on a 64 bit windows.

This has happened with some other 3:rd part dlls that we use in our application but this we have solved by changing the dlls in runtime to the ones built for x64 if the user are running on a 64 bit windows machine. Do any of you know where I can find DirectX 9 dlls for x64? If they exist at all.

The ones I need are:

  • Microsoft.DirectX.Direct3D
  • Microsoft.DirectX.Direct3DX
  • Microsoft.DirectX

If they do not exist, can the problem be solved in some other way? I cannot change the configuration to x86 because the application is released via ClickOnce and a change of configuration make ClickOnce stop working (the configuration is included in the ClickOnce key)


Let me add that the I am using a Winforms part hosted by the WPF application and that the winforms part is using the DirectX dlls I am asking about. This was a much better and faster way of presenting a lot of 3D meshes in WPF than to use WPF:s 3D. Unfortunately this problem occurred instead.

Construct answered 27/3, 2009 at 9:47 Comment(2)
As an aside: XNA/windows forces itself to use 32-bit mode even on x64 - so I wonder if it simply isn't possible... I don't really know, though.Charcot
Just an FYI, WPF 3d stuff is a wrapper for direct X. They are pretty much one in the same. Give or take some stuff.Amnesia
G
5

The DLL's you need are for Managed DirectX. Unfortunately Microsoft no longer supports Managed DirectX and it's successor, XNA does not support 64bit either.

SlimDX is an open source alternative to Managed DirectX, and it supports 64bit. The other option is to write the DirectX code in unmanaged C++.

Gyron answered 27/3, 2009 at 11:2 Comment(4)
Thanks for answering. So basically I have to re-program the entire 3d part if I want it to be able to run on x64. This Any CPU-configuration sucks...Construct
Well specifically Microsofts support of direct x in a managed environment sucks, but yeah. Given the push with DirectX/WPF interop I'm hoping to see better support in the future.Gyron
Another option forums.create.msdn.com/forums/t/90094.aspx mixing with xna.Woodring
@Lavinski XNA does not support 64 Bit, as I said in my answer.Gyron
B
0

You can set your WPF application to only run as a 32-bit app. Post your ClickOnce problem as another SO question. This is probably your best option.

Project Properties -> Build -> Platform Target -> x86

Broadnax answered 26/4, 2012 at 18:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.