edgar-mtz-e / slimdx

Automatically exported from code.google.com/p/slimdx
0 stars 0 forks source link

EffectHandle.ToString() is broken. #279

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
String constructor throws ArgumentOutOfRangeException("Pointer startIndex
and length do not refer to a valid string."). It happens only if handle is
returned from Effect.Get* methods. It works when you initialize
EffectHandle manually, e.g. handle = new EffectHandle("SomeString").

GetHashCode() uses similiar code so it has the same problem.

Original issue reported on code.google.com by lpata...@gmail.com on 8 Jun 2008 at 3:23

GoogleCodeExporter commented 9 years ago
I did a little research, and apparently handles returned by DirectX are, 
although
char pointers, not really strings, and should not be treated as such. I'm just 
going
to remove the ToString method here to avoid this confusion altogether. If you 
want to
get the name, you can use the Get***Description methods to find out more 
information
about the handle.

Original comment by Mike.Popoloski on 8 Jun 2008 at 4:33