简体   繁体   English

64位窗口上的DirectX应用程序

[英]DirectX application on 64 bit windows

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). 我正在开发一个WPF应用程序,其中3D部分由DirectX 9处理(很多3D使用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). 问题是应用程序以“Any CPU”作为配置发布,当用户在64位窗口上运行时,direcX部分崩溃(System.BadImageFormatException)。 Apparently the dlls included for the directX part is not usable on a 64 bit windows. 显然,directX部分包含的dll在64位窗口上不可用。

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. 这与我们在我们的应用程序中使用的其他3:rd部分dll有关,但是如果用户在64位Windows机器上运行,我们已经通过将运行时的dll更改为为x64构建的dll来解决。 Do any of you know where I can find DirectX 9 dlls for x64? 你们中的任何人都知道我在哪里可以找到x64的DirectX 9 dll吗? If they exist at all. 如果它们存在的话。

The ones I need are: 我需要的是:

  • Microsoft.DirectX.Direct3D Microsoft.DirectX.Direct3D
  • Microsoft.DirectX.Direct3DX Microsoft.DirectX.Direct3DX
  • Microsoft.DirectX 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) 我无法将配置更改为x86,因为应用程序是通过ClickOnce发布的,配置更改使ClickOnce停止工作(配置包含在ClickOnce键中)


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. 让我补充一点,我正在使用由WPF应用程序托管的Winforms部分,而winforms部分正在使用我询问的DirectX dll。 This was a much better and faster way of presenting a lot of 3D meshes in WPF than to use WPF:s 3D. 这是在WPF中呈现大量3D网格比使用WPF:3D更好更快的方式。 Unfortunately this problem occurred instead. 不幸的是发生了这个问题。

The DLL's you need are for Managed DirectX. 你需要的DLL是Managed DirectX。 Unfortunately Microsoft no longer supports Managed DirectX and it's successor, XNA does not support 64bit either. 不幸的是,微软不再支持Managed DirectX,它是后续产品,XNA也不支持64位。

SlimDX is an open source alternative to Managed DirectX, and it supports 64bit. SlimDX是Managed DirectX的开源替代品,它支持64位。 The other option is to write the DirectX code in unmanaged C++. 另一种选择是在非托管C ++中编写DirectX代码。

You can set your WPF application to only run as a 32-bit app. 您可以将WPF应用程序设置为仅作为32位应用程序运行。 Post your ClickOnce problem as another SO question. 将您的ClickOnce问题发布为另一个SO问题。 This is probably your best option. 这可能是你最好的选择。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM