title: How to conditionally execute function if operating system supports it?
body: <p>I'd like to build an application that invokes <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa363792%28v=vs.85%29.aspx" rel="nofollow">CancelIoEx</a> on Windows Vista and newer (where it is supported) and does something else on Windows XP (where it is not).</p>
  
  <ol>
  <li><p>What happens if I compile the application under Windows 7 but run it under Windows XP? What will happen at runtime? Will I get some sort of load error?</p></li>
  <li><p>How do I get my application to pick one code path or another (avoiding load errors) depending on what operating system is being used at runtime? Please provide sample code.</p></li>
  </ol>
  
  <p><strong>UPDATE</strong>: Please note that the DLL exists on Windows XP but the function does not.</p>