Hello,
I am unsure of exactly why you are getting the problem you are but this is what I found out as I looked into it.
getMeter() returns a domFloat, which is actually a c++ double. When casting it to a float you sometimes get some error. The file I tested this on used meter=“0.01” and the value I got after the cast was 0.009999999998.
But tests with the value of 0.0 or 1.0 there was no inaccuracy.
I really don’t know why you are getting such an odd value.
I don’t know what to tell you. I cannot recreate this issue you are having.
If the <unit> element is not in the document being loaded you would get NULL in that check. If the <unit> is specified but the “meter” attribute is ommitted the default value should be set to 1.0. If the “meter” attribute is specified then it should read it without any problems. I tested all 3 of these cases and they all worked correctly.
This is all auto-generated code from the schema. It gets handled in a generic manner. If this didn’t work here then there would be the same problem everywhere.
I’m sorry I don’t know how to help you any further but if you figure out exactly what is causing this I would be interested in hearing about it.
-Andy
When I debug the value is good, it’s just that the function doesn’t return the good value. Ther is a shift of 4 bytes I think when I look in the in the assemblor code.
As it works now, I’m not sure i want to spend hours to find a solution.
Its just a pointer to a string. That wouldn’t overrun any other memory,
unless the reflection is wrong and the compiler is generating the wrong offset and storing the pointer in the wrong place.
jairbubbles, what OS are you running? and anything else not typical on your system? are you running a 64bit OS?