DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 9 of 9

Thread: InternetSetOption in VB6

  1. #1
    B. Williams Guest

    InternetSetOption in VB6

    Please help with the InternetSetOption in VB6. I try to send Username and
    Password to the proxy server to get to the internet. I don't know how to
    make it work with the function. Can someone please help?

    strUsername="myID"
    strPassword="myPassword"

    hProxyUsername = InternetSetOption(hHttpOpenRequest, _
    INTERNET_OPTION_PROXY_USERNAME, strUsername, Len(strUsername))
    hProxyPassword = InternetSetOption(hHttpOpenRequest, _
    INTERNET_OPTION_PROXY_PASSWORD, strPassword, Len(strPassword))


    If I use InternetErrorDlg, it works fine. The only thing I don't want to
    have it it my app just because I have to press enter everytime I use it (or
    at least the first time). I also want to know the differences between
    InternetSetOption and InternetSetOptionStr. I'd greatly appreciate any help.




  2. #2
    Bill McCarthy Guest

    Re: InternetSetOption in VB6

    Hi,

    AFAIK, there is no such function as InternetSetOptionStr, at least not in
    the winInet.h
    What it probably is, is a VB declaration of the InternetSetOption function,
    with the params specified as ByVal xxx as String.

    So depending ong how you have your InternetSetOption declared, you could
    try:

    blnUserNameSet = InternetSetOption(hHttpOpenRequest, _
    INTERNET_OPTION_PROXY_USERNAME, ByVal strUsername,
    Len(strUsername))

    that is assuming you are declaring the function like:

    Declare Function InternetSetOptionA Lib "WININET" (ByVal hInternet As
    Long,ByVal dwOption as Long,
    lpBuffer As Any,ByVal dwBufferLength as Long) as Boolean


    "B. Williams" <nomail> wrote in message news:39302268$1@news.devx.com...
    > Please help with the InternetSetOption in VB6. I try to send Username and
    > Password to the proxy server to get to the internet. I don't know how to
    > make it work with the function. Can someone please help?
    >
    > strUsername="myID"
    > strPassword="myPassword"
    >
    > hProxyUsername = InternetSetOption(hHttpOpenRequest, _
    > INTERNET_OPTION_PROXY_USERNAME, strUsername, Len(strUsername))
    > hProxyPassword = InternetSetOption(hHttpOpenRequest, _
    > INTERNET_OPTION_PROXY_PASSWORD, strPassword, Len(strPassword))
    >
    >
    > If I use InternetErrorDlg, it works fine. The only thing I don't want to
    > have it it my app just because I have to press enter everytime I use it

    (or
    > at least the first time). I also want to know the differences between
    > InternetSetOption and InternetSetOptionStr. I'd greatly appreciate any

    help.
    >
    >
    >




  3. #3
    Bill McCarthy Guest

    Re: InternetSetOption in VB6

    Hi,

    AFAIK, there is no such function as InternetSetOptionStr, at least not in
    the winInet.h
    What it probably is, is a VB declaration of the InternetSetOption function,
    with the params specified as ByVal xxx as String.

    So depending ong how you have your InternetSetOption declared, you could
    try:

    blnUserNameSet = InternetSetOption(hHttpOpenRequest, _
    INTERNET_OPTION_PROXY_USERNAME, ByVal strUsername,
    Len(strUsername))

    that is assuming you are declaring the function like:

    Declare Function InternetSetOptionA Lib "WININET" (ByVal hInternet As
    Long,ByVal dwOption as Long,
    lpBuffer As Any,ByVal dwBufferLength as Long) as Boolean


    "B. Williams" <nomail> wrote in message news:39302268$1@news.devx.com...
    > Please help with the InternetSetOption in VB6. I try to send Username and
    > Password to the proxy server to get to the internet. I don't know how to
    > make it work with the function. Can someone please help?
    >
    > strUsername="myID"
    > strPassword="myPassword"
    >
    > hProxyUsername = InternetSetOption(hHttpOpenRequest, _
    > INTERNET_OPTION_PROXY_USERNAME, strUsername, Len(strUsername))
    > hProxyPassword = InternetSetOption(hHttpOpenRequest, _
    > INTERNET_OPTION_PROXY_PASSWORD, strPassword, Len(strPassword))
    >
    >
    > If I use InternetErrorDlg, it works fine. The only thing I don't want to
    > have it it my app just because I have to press enter everytime I use it

    (or
    > at least the first time). I also want to know the differences between
    > InternetSetOption and InternetSetOptionStr. I'd greatly appreciate any

    help.
    >
    >
    >




  4. #4
    B. Williams Guest

    Re: InternetSetOption in VB6

    WRONG! It's in VB wininet.bas from Microsoft.


    "Bill McCarthy" <Bill_McC@iprimus.com.au> wrote in message
    news:393a7398@news.devx.com...
    > Hi,
    >
    > AFAIK, there is no such function as InternetSetOptionStr, at least not in
    > the winInet.h
    > What it probably is, is a VB declaration of the InternetSetOption

    function,
    > with the params specified as ByVal xxx as String.
    >
    > So depending ong how you have your InternetSetOption declared, you could
    > try:
    >
    > blnUserNameSet = InternetSetOption(hHttpOpenRequest, _
    > INTERNET_OPTION_PROXY_USERNAME, ByVal strUsername,
    > Len(strUsername))
    >
    > that is assuming you are declaring the function like:
    >
    > Declare Function InternetSetOptionA Lib "WININET" (ByVal hInternet As
    > Long,ByVal dwOption as Long,
    > lpBuffer As Any,ByVal dwBufferLength as Long) as Boolean
    >
    >
    > "B. Williams" <nomail> wrote in message news:39302268$1@news.devx.com...
    > > Please help with the InternetSetOption in VB6. I try to send Username

    and
    > > Password to the proxy server to get to the internet. I don't know how to
    > > make it work with the function. Can someone please help?
    > >
    > > strUsername="myID"
    > > strPassword="myPassword"
    > >
    > > hProxyUsername = InternetSetOption(hHttpOpenRequest, _
    > > INTERNET_OPTION_PROXY_USERNAME, strUsername, Len(strUsername))
    > > hProxyPassword = InternetSetOption(hHttpOpenRequest, _
    > > INTERNET_OPTION_PROXY_PASSWORD, strPassword, Len(strPassword))
    > >
    > >
    > > If I use InternetErrorDlg, it works fine. The only thing I don't want to
    > > have it it my app just because I have to press enter everytime I use it

    > (or
    > > at least the first time). I also want to know the differences between
    > > InternetSetOption and InternetSetOptionStr. I'd greatly appreciate any

    > help.
    > >
    > >
    > >

    >
    >




  5. #5
    B. Williams Guest

    Re: InternetSetOption in VB6

    WRONG! It's in VB wininet.bas from Microsoft.


    "Bill McCarthy" <Bill_McC@iprimus.com.au> wrote in message
    news:393a7398@news.devx.com...
    > Hi,
    >
    > AFAIK, there is no such function as InternetSetOptionStr, at least not in
    > the winInet.h
    > What it probably is, is a VB declaration of the InternetSetOption

    function,
    > with the params specified as ByVal xxx as String.
    >
    > So depending ong how you have your InternetSetOption declared, you could
    > try:
    >
    > blnUserNameSet = InternetSetOption(hHttpOpenRequest, _
    > INTERNET_OPTION_PROXY_USERNAME, ByVal strUsername,
    > Len(strUsername))
    >
    > that is assuming you are declaring the function like:
    >
    > Declare Function InternetSetOptionA Lib "WININET" (ByVal hInternet As
    > Long,ByVal dwOption as Long,
    > lpBuffer As Any,ByVal dwBufferLength as Long) as Boolean
    >
    >
    > "B. Williams" <nomail> wrote in message news:39302268$1@news.devx.com...
    > > Please help with the InternetSetOption in VB6. I try to send Username

    and
    > > Password to the proxy server to get to the internet. I don't know how to
    > > make it work with the function. Can someone please help?
    > >
    > > strUsername="myID"
    > > strPassword="myPassword"
    > >
    > > hProxyUsername = InternetSetOption(hHttpOpenRequest, _
    > > INTERNET_OPTION_PROXY_USERNAME, strUsername, Len(strUsername))
    > > hProxyPassword = InternetSetOption(hHttpOpenRequest, _
    > > INTERNET_OPTION_PROXY_PASSWORD, strPassword, Len(strPassword))
    > >
    > >
    > > If I use InternetErrorDlg, it works fine. The only thing I don't want to
    > > have it it my app just because I have to press enter everytime I use it

    > (or
    > > at least the first time). I also want to know the differences between
    > > InternetSetOption and InternetSetOptionStr. I'd greatly appreciate any

    > help.
    > >
    > >
    > >

    >
    >




  6. #6
    Eduardo A. Morcillo Guest

    Re: InternetSetOption in VB6

    > WRONG! It's in VB wininet.bas from Microsoft.

    WRONG!

    As Bill said it's just a redefinition for InternetSetOption (look at the
    Alias keyword):

    Public Declare Function InternetSetOptionStr Lib "wininet.dll" Alias
    "InternetSetOptionA" _
    (ByVal hInternet As Long, ByVal lOption As Long, ByVal sBuffer As String,
    ByVal lBufferLength As Long) As Integer


    --
    Eduardo A. Morcillo
    http://www.domaindlx.com/e_morcillo



  7. #7
    Eduardo A. Morcillo Guest

    Re: InternetSetOption in VB6

    > WRONG! It's in VB wininet.bas from Microsoft.

    WRONG!

    As Bill said it's just a redefinition for InternetSetOption (look at the
    Alias keyword):

    Public Declare Function InternetSetOptionStr Lib "wininet.dll" Alias
    "InternetSetOptionA" _
    (ByVal hInternet As Long, ByVal lOption As Long, ByVal sBuffer As String,
    ByVal lBufferLength As Long) As Integer


    --
    Eduardo A. Morcillo
    http://www.domaindlx.com/e_morcillo



  8. #8
    Bill McCarthy Guest

    Re: InternetSetOption in VB6

    Really !!

    Now, please try reading my post. I explicitly referred to the wininet.h
    file -- it is a "standard" or the specs for the exported wininet dll
    functions. If you write declares in VB and give them aliases well you could
    call them anything.. So to clarify once more: "AFAIK, there is no such
    function as InternetSetOptionStr, at least not in the winInet.h "

    Now, did you try using the InternetSetOptionA and then pass it the strings
    byVal as I suggested ?





    "B. Williams" <nomail> wrote in message news:393b3642@news.devx.com...
    > WRONG! It's in VB wininet.bas from Microsoft.
    >
    >
    > "Bill McCarthy" <Bill_McC@iprimus.com.au> wrote in message
    > news:393a7398@news.devx.com...
    > > Hi,
    > >
    > > AFAIK, there is no such function as InternetSetOptionStr, at least not

    in
    > > the winInet.h
    > > What it probably is, is a VB declaration of the InternetSetOption

    > function,
    > > with the params specified as ByVal xxx as String.
    > >
    > > So depending ong how you have your InternetSetOption declared, you could
    > > try:
    > >
    > > blnUserNameSet = InternetSetOption(hHttpOpenRequest, _
    > > INTERNET_OPTION_PROXY_USERNAME, ByVal strUsername,
    > > Len(strUsername))
    > >
    > > that is assuming you are declaring the function like:
    > >
    > > Declare Function InternetSetOptionA Lib "WININET" (ByVal hInternet As
    > > Long,ByVal dwOption as Long,
    > > lpBuffer As Any,ByVal dwBufferLength as Long) as Boolean
    > >
    > >
    > > "B. Williams" <nomail> wrote in message news:39302268$1@news.devx.com...
    > > > Please help with the InternetSetOption in VB6. I try to send Username

    > and
    > > > Password to the proxy server to get to the internet. I don't know how

    to
    > > > make it work with the function. Can someone please help?
    > > >
    > > > strUsername="myID"
    > > > strPassword="myPassword"
    > > >
    > > > hProxyUsername = InternetSetOption(hHttpOpenRequest, _
    > > > INTERNET_OPTION_PROXY_USERNAME, strUsername, Len(strUsername))
    > > > hProxyPassword = InternetSetOption(hHttpOpenRequest, _
    > > > INTERNET_OPTION_PROXY_PASSWORD, strPassword, Len(strPassword))
    > > >
    > > >
    > > > If I use InternetErrorDlg, it works fine. The only thing I don't want

    to
    > > > have it it my app just because I have to press enter everytime I use

    it
    > > (or
    > > > at least the first time). I also want to know the differences between
    > > > InternetSetOption and InternetSetOptionStr. I'd greatly appreciate any

    > > help.
    > > >
    > > >
    > > >

    > >
    > >

    >
    >




  9. #9
    Bill McCarthy Guest

    Re: InternetSetOption in VB6

    Really !!

    Now, please try reading my post. I explicitly referred to the wininet.h
    file -- it is a "standard" or the specs for the exported wininet dll
    functions. If you write declares in VB and give them aliases well you could
    call them anything.. So to clarify once more: "AFAIK, there is no such
    function as InternetSetOptionStr, at least not in the winInet.h "

    Now, did you try using the InternetSetOptionA and then pass it the strings
    byVal as I suggested ?





    "B. Williams" <nomail> wrote in message news:393b3642@news.devx.com...
    > WRONG! It's in VB wininet.bas from Microsoft.
    >
    >
    > "Bill McCarthy" <Bill_McC@iprimus.com.au> wrote in message
    > news:393a7398@news.devx.com...
    > > Hi,
    > >
    > > AFAIK, there is no such function as InternetSetOptionStr, at least not

    in
    > > the winInet.h
    > > What it probably is, is a VB declaration of the InternetSetOption

    > function,
    > > with the params specified as ByVal xxx as String.
    > >
    > > So depending ong how you have your InternetSetOption declared, you could
    > > try:
    > >
    > > blnUserNameSet = InternetSetOption(hHttpOpenRequest, _
    > > INTERNET_OPTION_PROXY_USERNAME, ByVal strUsername,
    > > Len(strUsername))
    > >
    > > that is assuming you are declaring the function like:
    > >
    > > Declare Function InternetSetOptionA Lib "WININET" (ByVal hInternet As
    > > Long,ByVal dwOption as Long,
    > > lpBuffer As Any,ByVal dwBufferLength as Long) as Boolean
    > >
    > >
    > > "B. Williams" <nomail> wrote in message news:39302268$1@news.devx.com...
    > > > Please help with the InternetSetOption in VB6. I try to send Username

    > and
    > > > Password to the proxy server to get to the internet. I don't know how

    to
    > > > make it work with the function. Can someone please help?
    > > >
    > > > strUsername="myID"
    > > > strPassword="myPassword"
    > > >
    > > > hProxyUsername = InternetSetOption(hHttpOpenRequest, _
    > > > INTERNET_OPTION_PROXY_USERNAME, strUsername, Len(strUsername))
    > > > hProxyPassword = InternetSetOption(hHttpOpenRequest, _
    > > > INTERNET_OPTION_PROXY_PASSWORD, strPassword, Len(strPassword))
    > > >
    > > >
    > > > If I use InternetErrorDlg, it works fine. The only thing I don't want

    to
    > > > have it it my app just because I have to press enter everytime I use

    it
    > > (or
    > > > at least the first time). I also want to know the differences between
    > > > InternetSetOption and InternetSetOptionStr. I'd greatly appreciate any

    > > help.
    > > >
    > > >
    > > >

    > >
    > >

    >
    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center