[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 Format­Message function ignores the lpSource parameter if neither FORMAT_MESSAGE_FROM_HMODULE nor FORMAT_MESSAGE_FROM_STRING 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

Popular posts from this blog

Scenarios capability now generally available for Amazon Q in QuickSight - devamazonaws.blogspot.com

Research and Engineering Studio on AWS Version 2024.08 now available - devamazonaws.blogspot.com

Amazon EC2 C6id instances are now available in AWS Europe (Paris) region - devamazonaws.blogspot.com