[MS] If a parameter isn’t used, what should I pass? - devamazonaws.blogspot.com
There are several places in the Windows API where a parameter is used only under certain conditions and is otherwise ignored. A customer wanted to know what to pass for an unused parameter.
"I know that it says that the FormatMessage
function ignores the lpSource parameter if neither FORMAT_
nor FORMAT_
is passed. So what should I use if I'm not passing either of those flags?"
This is the developer version of "The computer says to press any key, but I don't have a key called Any."
Instead of asking the customer to contemplate whether a parameter that is never used makes a sound, I just answered, "Just pass nullptr
."
You sometimes see this recommendation in the Windows documentation. "Under condition X, the parameter is not used and should be zero."
Sometimes it's easier to just give an answer than to engage in a philosophical discussion.
Post Updated on February 29, 2024 at 03:00PM
Thanks for reading
from devamazonaws.blogspot.com
Comments
Post a Comment