Help Please? Can't figure this one out.

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi to all. I have the following code in a VB app:

**** CODE SNIPETT START
Private Sub PostFile(strServer As String, strLocalFile As String, strURL As
String, Optional strUser As String, Optional strPass As String)
Dim hSession, hConnect, hRequest, hOpenUrl As Long

MORE CODE HERE that is not relevant....

If CBool(hRequest) Then
blnRequestEXok = UseHttpSendReqEx(hRequest, strLocalFile) ERROR HERE, vb
hilights hRequest as the offending dude!!!
End If

Call InternetCloseHandle(hRequest)
Call InternetCloseHandle(hConnect)
Call InternetCloseHandle(hSession)
End Sub

Private Function UseHttpSendReqEx(hRequest As Long, strUpFile As String) As
Boolean

**** CODE SNIPPET ENDS

When I try to run the app, I get the following:

Compile Error!
ByRef Argument Type Mismatch


VB indicates the error is in the line labled ERROR HERE above.


The Parameter list for UseHttpSendReqEx clearly has hRequest declared as
LONG, while strUpFile is a string (so is strLocalFile).

VB Hilights hRequest in the calling routine (line labelled ERROR HERE).


What am I not seeing here?

Thanks to all.

Wiley.




.



Relevant Pages

  • Re: Help Please? Cant figure this one out.
    ... hSession, hConnect, and hRequest are declared as Variant. ... Only hOpenUrL is declared as Long. ... > Private Sub PostFile(strServer As String, strLocalFile As String, strURL ...
    (microsoft.public.vb.enterprise)
  • Cant figure out this error:
    ... Private Sub PostFile(strServer As String, strLocalFile As String, strURL As ... String, Optional strUser As String, Optional strPass As String) ... VB Hilights hRequest in the calling routine. ...
    (microsoft.public.vstudio.development)
  • Can someone help with this Error?
    ... Private Sub PostFile(strServer As String, strLocalFile As String, strURL As ... String, Optional strUser As String, Optional strPass As String) ... Dim hSession, hConnect, hRequest, hOpenUrl As Long ...
    (microsoft.public.vb.general.discussion)
  • Help! I cant figure this one out.
    ... Private Sub PostFile(strServer As String, strLocalFile As String, strURL As ... String, Optional strUser As String, Optional strPass As String) ... Dim hSession, hConnect, hRequest, hOpenUrl As Long ...
    (microsoft.public.vstudio.general)
  • Re: Can someone help with this Error?
    ... > Private Sub PostFile(strServer As String, strLocalFile As String, ... > VB Hilights hRequest in the calling routine (line labelled ERROR ...
    (microsoft.public.vb.general.discussion)