title: Visual Basic for Application winhttp.dll WinHttpOpenRequest returns 87 (invalid parameter)
body: <p>this is WinHttpOpenRequest function:</p>
  <pre><code>WINHTTPAPI HINTERNET WinHttpOpenRequest(
  HINTERNET hConnect,
  LPCWSTR   pwszVerb,
  LPCWSTR   pwszObjectName,
  LPCWSTR   pwszVersion,
  LPCWSTR   pwszReferrer,
  LPCWSTR   *ppwszAcceptTypes,
  DWORD     dwFlags
  );
  </code></pre>
  <p>and this is my code:</p>
  <pre><code>Public Declare PtrSafe Function WinHttpOpenRequest Lib &quot;winhttp.dll&quot; (ByVal hConnect As LongPtr, ByVal pwszVerb As String, ByVal pwszObjectName As String, ByVal pwszVersion As String, ByVal pwszReferrer As String, ByRef ppwszAcceptTypes As String, ByVal dwFlags As Long) As LongPtr
  requestHandle = WinHttpOpenRequest(connectHandle, &quot;GET&quot;, vbNullString, vbNullString, vbNullString, vbNullString, 0)
  </code></pre>
  <p>And If I call <code>MsgBox Err.LastDllError</code>, I get 87 error (invalid parameter).
  I think that ppwszAcceptTypes's type or ByVal/ByRef is wrong, but I can't be sure. (LPCWSTR *pointer to ByRef String?) How should I edit it?</p>
  <p>Thanks.</p>