directx vb.NET error

d1820

Member
Joined
Apr 25, 2003
Messages
8
I get the following error when i converted my vb6 directx app to vb.NET any one ever seen this, if so how did you fix it. going to directX 9 is not an option.

D3DXMATH_MATRIX is not a member of DxVBLibA.
 
Since no one else answered...

I got this today just after lunch. Three hours later, I finally found the answer at msdn.microsoft.com: youre up the creek. Going to DX9, even if it were an option, wouldnt fix the problem either: the only solution is to go back to VB6.

Technical answer: in .NET, COM objects only expose the methods in classes. Methods that are in modules are not allowed in .NET. (Interestingly, MS uses DirectX as an example of this "rare occurrence.") MS suggests you find whatever tool in .NET that allows the same functionality.

Well, I guess all the time I spent learning DX is out the window, and I have to start learning GDI+. Which doesnt have 3D. What fun.

R
 
What exactly are you trying to do with a Matrix? The Matrix object has numerous static methods for doing what the old Module used to do, such as Translate, Scale, LookAtLH, RotationQuaternion and more.

-Nerseus
 
>What exactly are you trying to do with a Matrix? The Matrix object
>has numerous static methods for doing what the old Module used to
>do, such as Translate, Scale, LookAtLH, RotationQuaternion and
>more.

So very nice of Microsofts documentation to mention that. Ill dig into it....

R
 
Heh... The documentation on Managed Dx is downright painful. Most of it (if it exists) appears to be written by a summer student. :P

I particularly enjoyed example code commented with phrases like "get rid of this crap" and "blow out of here". Good work with the QC there, MS.
 
Well they get it at both ends. Everyone wanted DX9 "NOW!", but others complain that it wasnt documented well enough. Its a shame they couldnt wait for some better docs as thats what most people seem to be focusing on (since its hard to figure anything out if youre not used to DX8 or prior and not willing to look at the C++ documentation).

Many of the DX9 objects have static methods and/or properties. You can browse them in the object browser or just type Matrix. and look through the intellisense.

-Nerseus
 
I _am_ looking at the C++ documentation... chuckle. (Im new to VB, but C++, that Ive been doing for over a decade.)

So I dug up Matrix-- interesting that its in system.drawing.2d. I wondered why there wasnt a system.drawing.3d. Anyway, we have IsIdentity(), but I dont see a matching identity setter. The first line it chokes on is the basic

DxVBLibA.D3DMATH_MATRIX.D3DXMatrixIdentity(matWorld)

I can kludge RotateY, and of course Multiply is there (so is LookAtLH? Where?), but the next command down I cant fathom from playing in the Object Browser is

DxVBLibA.D3DXMATH_MATRIX.D3DXMatrixPerspectiveFovLH(add long string of parameters)

I guess the question to be asked, sort of referenced above, is: IS there a relatively simple way (and I do consider just going through the code and changing everything-- as long as theres some sort of one-to-one translation-- "relatively simple") to pull all the DX stuff that .NET doesnt like into .NET? Or, a related question: how much farther beyond that can I go? Im guessing theres still going to be some COM in here, but if you take the basic spinning-cube program written in VB6/DirectX 8 (or 9), what percentage of the DX COM code can now be written natively in .NET? As an estimate of course.

And the most important question, is there a book/webpage/resource/tutorial that documents it all?

Sorry, got a bit long-winded there, all I was going to do was ask about MatrixIdentity...

R
 
And, though Im sure its obvious, most of what you want is in the Microsoft.DirectX.Direct3D namespace.

I havent seen any simple standard Dx9 code that couldnt be written using managed Dx yet. Sometimes its a pain in the arse (as the standard Dx way of doing things does not always have a direct equivalent in MDX). But even things like swap chains (which we found to be an interesting experience in Midget3D) can be done easily in MDX once you figure out how.

You mentioned the "basic cube spinning example". If you havent been there yet, have a look at http://www.directx4vb.com/. Jacks tutorial takes you right through building a cube-spinning demo. :)
 
Originally posted by steved

You mentioned the "basic cube spinning example". If you havent been there yet, have a look at http://www.directx4vb.com/. Jacks tutorial takes you right through building a cube-spinning demo. :)

That DirectXvb site and the article writter are excellent VB Dx references. Ive been using him for years, and I totally recommend him.
 
Back
Top