I have an app that takes a user batch and generates a dialog. In building the display GetTextExtentPoint32() is called to determine if the next item (button/text/combo box/custom control)will fit on the current line. In one particularly long batch this is getting called 4043 times. I ran MSDevStudio profiler, and it indicates that this call is the main slowdown for the display generation.
Is there a way to speed this up, or is there a more efficient way to determine the horizontal extent of a string?
I have forced the function inline with little improvement.