VB.Net Format Against C#

  • Thread starter Thread starter Clark Kent
  • Start date Start date
C

Clark Kent

HI!


Any one can tell why VB.Net gives error

Operator '*' is not defined for types 'Microsoft.DirectX.Matrix' and
'Microsoft.DirectX.Matrix'.

from lines that are below and in C# it works just fine?

How ill solve this? Totally lost now.



EXAMPLES:

VB.Net

Dim m As Matrix = Matrix.Translation(0, 0.4F, 0)

m *= Me.TransformMatrix()

dev.Transform.World = m

C#

Matrix m = Matrix.Translation(0,0.4f,0);

m *= this.TransformMatrix();

dev.Transform.World = m;
 
Hello,

Clark Kent said:
Any one can tell why VB.Net gives error

Operator '*' is not defined for types 'Microsoft.DirectX.Matrix' and
'Microsoft.DirectX.Matrix'.

from lines that are below and in C# it works just fine?

How ill solve this? Totally lost now.

VB .NET doesn't support operator overloading. You may want to use the
Multiply method of the Matrix class.

HTH,
Herfried K. Wagner
 
Clark Kent said:
Any one can tell why VB.Net gives error

Operator '*' is not defined for types 'Microsoft.DirectX.Matrix'
and 'Microsoft.DirectX.Matrix'.

from lines that are below and in C# it works just fine?

How ill solve this? Totally lost now.

You can't multiply matrices using the * operator. Only basic data types can
be multiplied.

See language specification, chapter 10.5.3:
VB and C#
Reference
VB language
VB.NET language specifications
10. Operators
10.5
10.5.3
 
Back
Top