title: Use WinHTTP in Visual Studio 6.0
body: <p>I am maintaining a legacy app written in Visual Studio C++ 6.0.</p>
  <p>I need to replace portion of the code with calls to WinHTTP API.</p>
  <p>I have created small demo in Visual Studio 6.0 test project so I can see how would things go.</p>
  <p>When I build the code I get the following error ( the same code works flawlessly in Visual Studio 2013 ) :</p>
  <p><code>fatal error C1083: Cannot open include file: 'winhttp.h': No such file or directory</code></p>
  <p>I have added the Include path, like in the below image:</p>
  <p><a href="https://i.stack.imgur.com/PWONz.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PWONz.jpg" alt="enter image description here" /></a></p>
  <p>I have added the path to library, like in the below image:</p>
  <p><a href="https://i.stack.imgur.com/csDZF.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/csDZF.jpg" alt="enter image description here" /></a></p>
  <p>After trying to compile I get this:</p>
  <pre><code>error C2146: syntax error : missing ';' before identifier 'dwResult'
  error C2501: 'DWORD_PTR' : missing storage-class or type specifiers
  error C2501: 'dwResult' : missing storage-class or type specifiers
  error C2065: '__in' : undeclared identifier
  error C2143: syntax error : missing ')' before 'const'
  warning C4229: anachronism used : modifiers on data are ignored
  error C2491: 'WinHttpTimeFromSystemTime' : definition of dllimport data not allowed
  error C2059: syntax error : ')'
  error C2065: '__in_z' : undeclared identifier
  error C2146: syntax error : missing ')' before identifier 'LPCWSTR'
  warning C4229: anachronism used : modifiers on data are ignored
  error C2491: 'WinHttpTimeToSystemTime' : definition of dllimport data not allowed
  error C2059: syntax error : ')'
  error C2065: '__in_ecount' : undeclared identifier
  error C2065: 'dwUrlLength' : undeclared identifier
  error C2146: syntax error : missing ')' before identifier 'LPCWSTR'
  warning C4229: anachronism used : modifiers on data are ignored
  error C2491: 'WinHttpCrackUrl' : definition of dllimport data not allowed
  error C2059: syntax error : ')'
  error C2146: syntax error : missing ')' before identifier 'LPURL_COMPONENTS'
  warning C4229: anachronism used : modifiers on data are ignored
  error C2491: 'WinHttpCreateUrl' : definition of dllimport data not allowed
  error C2059: syntax error : ')'
  error C2065: '__in_z_opt' : undeclared identifier
  error C2146: syntax error : missing ')' before identifier 'LPCWSTR'
  warning C4229: anachronism used : modifiers on data are ignored
  error C2491: 'WinHttpOpen' : definition of dllimport data not allowed
  error C2440: 'initializing' : cannot convert from 'int' to 'void *'
              Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
  error C2059: syntax error : ')'
  error C2061: syntax error : identifier '__out_bcount_part'
  error C2061: syntax error : identifier '__in_bcount_opt'
  error C2061: syntax error : identifier '__out_data_source'
  error C2059: syntax error : 'return'
  warning C4518: '__declspec(dllimport ) ' : storage-class or type specifier(s) unexpected here; ignored
  error C2146: syntax error : missing ';' before identifier 'BOOL'
      workaround.h(426) : fatal error C1004: unexpected end of file found
  </code></pre>
  <p>After moving the newly added paths to the top, I have got only one error:</p>
  <p><code>c:\program files (x86)\microsoft sdks\windows\v7.1a\include\specstrings.h(11) : fatal error C1083: Cannot open include file: 'sal.h': No such file or directory</code></p>
  <p>I have copy/pasted <code>sal.h</code> and <code>ConcurrencySal.h</code> into VC98/Include, and have copy/pasted directory CodeAnalysis as well.</p>
  <p>Now I get following errors:</p>
  <pre><code>c:\program files (x86)\microsoft visual studio\vc98\include\sal.h(708) : warning C4068: unknown pragma
  c:\program files (x86)\microsoft visual studio\vc98\include\sal.h(1472) : warning C4068: unknown pragma
  c:\program files (x86)\microsoft visual studio\vc98\include\sal.h(2866) : warning C4005: '__useHeader' : macro redefinition
          c:\program files (x86)\microsoft sdks\windows\v7.1a\include\sal_supp.h(57) : see previous definition of '__useHeader'
  c:\program files (x86)\microsoft visual studio\vc98\include\sal.h(2876) : warning C4005: '__on_failure' : macro redefinition
          c:\program files (x86)\microsoft sdks\windows\v7.1a\include\specstrings_supp.h(77) : see previous definition of '__on_failure'
  c:\program files (x86)\microsoft sdks\windows\v7.1a\include\winnt.h(3994) : warning C4035: 'ReadPMC' : no return value
  c:\program files (x86)\microsoft sdks\windows\v7.1a\include\winnt.h(4023) : warning C4035: 'ReadTimeStampCounter' : no return value
  c:\program files (x86)\microsoft sdks\windows\v7.1a\include\winnt.h(12804) : error C2144: syntax error : missing ';' before type 'int'
  c:\program files (x86)\microsoft sdks\windows\v7.1a\include\winnt.h(12804) : error C2501: '__inner_checkReturn' : missing storage-class or type specifiers
  c:\program files (x86)\microsoft sdks\windows\v7.1a\include\winnt.h(12804) : fatal error C1004: unexpected end of file found
  </code></pre>
  <p>At the moment I am Googling for a solution to this problem...</p>
  <h1>Question:</h1>
  <p>Can you explain to me how to set up a project in Visual C++ 6 so it can use WinHTTP API (of course, if it is possible at all) ?</p>