Amazing Bug in StringFormat.SetMeasureableCharacterRange

G

Guest

I have no idea how this bug got past Microsoft's Testing! It's so straightforward

The following code snippet results in a System.OverflowExeption whenever it is executed
Regardless of where, why, or how

' Bug in StringFormat.SetMeasurableCharacterRanges
' OverFlow error occurs if the size of the CharacterRange array sent i
' greater than or equal to 33!!
Dim intTotalCharacters As Integer = 3
Dim characterRanges() As CharacterRang
Dim intIndex As Intege
Dim stringFormat As New StringForma

ReDim characterRanges(intTotalCharacters - 1
For intIndex = 0 To intTotalCharacters -
characterRanges(intIndex) = New CharacterRange(0, 1
Nex

stringFormat.SetMeasurableCharacterRanges(characterRanges

It doesn't matter that the ranges overlap. I've tried all possibilities an
they all result in the same Exception

How can something as simple as this not get discovered and fixed! Does anyone reall
use .NEt for serious development? There is pretty much no way anyone could print to a document and need to adjust for line wrapping without using this call
 
T

Tim Anderson

CharacterRangebug said:
I have no idea how this bug got past Microsoft's Testing! It's so straightforward.

The following code snippet results in a System.OverflowExeption whenever it is executed.
Regardless of where, why, or how.

According to a previous post from John Hornick[MS], it's a limitation of the
GDI+ API. If so, the Framework method may be designed to work with larger
CharacterRange arrays at some future point when the GDI+ API allows it.

The workaround is to do multiple calls using arrays at or below the limit.

Tim
IBM's take on web services:
http://www.itwriting.com/ibmwebservices.php
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top