I am now inclined to think - and in line with what you say - that it would be safer and more efficient to modify FillNumberFmt() to take two more arguments and pass the buffer sizes in as well, i.e., in effect, its declaration should be:
static void FillNumberFmt(NUMBERFMTW *fmt, LPWSTR decimal_buffer, int decbuf_wlen, LPSTR thousand_buffer, int thoubuf_wlen);
Does that sound better?
-- Andy.
Yes, it's probably more elegant to send the buffer sizes explicitly as a parameter than to use a constant.
Mikolaj Zalewski