Microsoft Developer Network >
Forums Home
>
Visual Studio Express Editions Forums
>
Visual Basic Express Edition
>
Windows 7 x64, DirectX 9, and VB2008EE
Windows 7 x64, DirectX 9, and VB2008EE
- I'll preface this by saying that I've asked this question in the Windows 7 forum area, and on the XNA forums, but haven't gotten any answers. Thougtht I would try here.
I'm trying to run a VB2008 application that uses DirectX under Windows 7 RC (64 bit). This is an application I wrote on a Vista machine. When I run the compiled application in Windows 7, I get the error message:
myappname has stopped working
From within VB2008 Express Edition, I am able to build the solution, but I cannot debug it. Trying to debug will throw the error:
InvalidOperationException was unhandled.
An error occured creating the form. See Exception.InnerException for details. The error is: is not a valid Win32 Application. (Exception from HRESULT: 0x800700C1)
This same project will debug, compile, and run fine under Windows XP or Vista (both test boxes are 32 bit).
A VB2008 project that does not require DirectX will run find under Windows 7.
The March 2009 DirectX SDK is installed on the Windows 7 machine, same as the XP and Vista machines.
Any idea how to get DirectX applications to work under Windows 7?
Sample VB code that throws the error:
Imports Microsoft.DirectX Imports Microsoft.DirectX.Direct3D Public Class Form1 Dim device As Direct3D.Device Dim MyTriangleStrip(3) As CustomVertex.PositionColored End Class
Thanks,
Lance
Answers
- It is very important to make sure Managed DirectX uses always x86 (32 bit) as the target platform. x64 is NOT supported and "Any CPU" will work on 32 bit because it will use x86 automatically, but on x64 bit platforms, x64 will be choosed. Since calling 32 bit dlls (which all Managed DirectX dlls are) is not possible from x64, you have to have your whole app in 32 bit mode!
Coding for fun Be a good forum member mark posts that contain the answers to your questions or those that are helpful- Marked As Answer bymx270a Wednesday, July 08, 2009 4:51 AM
All Replies
- It is very important to make sure Managed DirectX uses always x86 (32 bit) as the target platform. x64 is NOT supported and "Any CPU" will work on 32 bit because it will use x86 automatically, but on x64 bit platforms, x64 will be choosed. Since calling 32 bit dlls (which all Managed DirectX dlls are) is not possible from x64, you have to have your whole app in 32 bit mode!
Coding for fun Be a good forum member mark posts that contain the answers to your questions or those that are helpful- Marked As Answer bymx270a Wednesday, July 08, 2009 4:51 AM
- Awesome. That worked.
For reference, changing the target platform in VB Express is somewhat hidden. I followed the process in the 4th post here: http://forums.xna.com/forums/p/4377/22336.aspx
-Lance - If you really need it you can try Slimdx I don't know anything about it myself but this is what the feature page says .
Supported Systems
SlimDX supports a wide range of APIs, operating systems, and configurations. All versions of Windows XP, Vista, Server 2003, Server 2008, and 7 are supported, for both 32 and 64 bit. There is a minimum requirement of .NET 2.0, but any subsequent version (including or excluding service packs) will work.
..........
SlimDX includes 64 bit assemblies, and is the only DirectX interface for .NET to do so. The redistributable and SDK installers automatically register the correct assemblies. Applications can also compile for the "Any CPU" architecture when using SlimDX, and the correct version will be selected. As a result, SlimDX based applications can smoothly target both 32 and 64 bit machines without the headaches introduced by other similar libraries.
..........
64-bit Systems and "Any CPU"
http://slimdx.org/features.php
Coding for fun Be a good forum member mark posts that contain the answers to your questions or those that are helpful
