从DX7迁移到DX9 [英] Migrate From DX7 To DX9

查看:114
本文介绍了从DX7迁移到DX9的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!



我手中拿着一个使用Directx7(Direct3DCreate,DirectDrawCreate)的VB6旧代码。现在,要求我升级它至少在Windows7中工作。

所以,我必须使用DX9或更高版本。由于VB6不支持DX9,我将项目导入Visual Studio 2008(VB.NET)。

在开始更改函数以使用DX9之前我想编译当前的软件,但是出现以下错误:



Hi Everyone!

I have in my hands a old code made in VB6 that uses the Directx7 (Direct3DCreate, DirectDrawCreate). Now, was requested me to upgrade it to work at least in Windows7.
So, I have to use DX9 or higher. As VB6 doesn't support DX9, I imported the project to Visual Studio 2008 (VB.NET).
Before start changing the functions in order to use DX9 I would like to compile the current software, but following error is appearing:

Call D3dDevice.DrawPrimitive(DxVBLib.CONST_D3DPRIMITIVETYPE.D3DPT_TRIANGLELIST, DxVBLib.CONST_D3DFVFFLAGS.D3DFVF_VERTEX, Vertice(0), NActVert, DxVBLib.CONST_D3DDPFLAGS.D3DDP_WAIT)





错误消息:'DxVBLib.D3DVERTEX'类型的值无法转换为'System.IntPtr'



参考此上面调用的函数中的参数。

Vertice(0)



初始化如下:



Error Message: Value of type 'DxVBLib.D3DVERTEX' cannot be converted to 'System.IntPtr'

Making reference to this paramenter in the function called above.
Vertice(0)

it's initialized like:

Dim Vertice() As DxVBLib.D3DVERTEX







谢谢。




Thank you.

推荐答案

我不知道为什么直接在VB.NET中使用DirectX。您可以开发基于WPF的解决方案,WPF基于DirectX。我很难想象您需要WPF中没有的任何DirectX功能。让.NET和它的FCL关注与DirectX版本的兼容性。



我明白VB6开发对你的业务造成很大损害,因为这个产品从来没有任何严重甚至是可以接受的。但是现在你越早摆脱所有残余的那种发展就越好。 VB.NET也有一些问题:它没有标准化,因为C#是,而且几乎不会,但至少这是一种完全成熟的合法.NET语言,与其他语言相比没有任何严重的限制。



-SA
I have no idea why using DirectX directly with VB.NET. You can develop WPF-based solutions, and WPF is based on DirectX. I can hardly imagine that you would need any DirectX features not available in WPF. Let .NET and its FCL take care about compatibility with DirectX versions.

I understand that VB6 development damaged your business a lot, as this product was never anything serious or even acceptable. But now the sooner you get rid of all remnants of that development the better. VB.NET also has some problems: it is not standardized as C# is, and hardly will be, but at least this is a fully-fledged and legitimate .NET language, without any serious limitations compared to others.

—SA


我这样做了,看起来很有效。



I did this and seems work.

Convert.ToInt32(Vertice(0))


这篇关于从DX7迁移到DX9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆