Hi all,
I have a function that accepts an LPCTSTR. I want to add functionality to parameterized strings - that is, to have the LPCTSTR go through _vsntprint - but since it requires copying the string to a buffer, or making the current buffer larger, I want to call it only if the parameters list is not empty. I would want to use the same function I do now, without creating another version of it which accepts an ellipsis.
So, if my function looks like this: int Execute (LPCTSTR command) , I want it to look like this: int Execute (LPCTSTR command, ...). I'm then using va_start, but couldn't figure out how to see if it points to an empty parameters list or not. I'm not even sure using va_arg is possible for testing this (of course I will have to do va_list args-- after calling it). Passing an int with parameters count is not an option.
Any advice on how to do this (if at all possible)?
Stilgar.
Start Free Trial