it's not entirely clear what you want to achieve, but FormatRange() is for formatting text for a specific DC.
This doesn't actually draw something, it prepares for drawing, which is typically done...