CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    2

    Attention gurus : Help with Inet control : generates multiple "winoldap" sessions ...



    Hello,

    I have the following problem :

    I use inet control (VB5) for downloading a small text file from FTP.

    I use a fixed number of attempts(10) for successing, after which i consider download unsuccessfull if I end with some error.

    At each try (or attempt), i use "cancel" method after the attempt


    Whenever there is a problem, i have noticed that the control leaves in the system a lot of "winoldap" active sessions. And they end up crashing the program.


    Is there anything I can do ?


    TIA


    Yfh

  2. #2
    Join Date
    Apr 2000
    Location
    Karnataka,India
    Posts
    15

    Re: Attention gurus : Help with Inet control : generates multiple "winoldap" sessions ...

    I do have a similar problem, with inet control .I want to load an image[jpg,bmp,gif] from web server
    The downloaded image with the use of Inet control
    is not at all visible in Internet explorer,since if the original image size is 200x300 pixels
    the downloaded image size around 7x8 pixels


    I am writing the code ,if there is any problem please do feel free to write me at [email protected]


    private Sub Form_Load()
    Dim pname as string
    pname = "sbserver"
    Inet1.Proxy = pname
    Inet1.AccessType = icNamedProxy
    Text1.Text = Inet1.OpenURL("http://go.msn.com/zzs/0/b.asp")

    'Inet1.OpenURL("http://sbserver/ealbums/Gallery_act/ashphtogal10.jpg")
    Dim strURL as string ' URL string
    ' FreeFile variable
    Inet1.Execute "http://sbserver/ealbums/members/raom...ct/aish118.jpg", "get"
    Inet1.UserName = "mohit"
    End Sub

    private Sub Inet1_StateChanged(byval State as Integer)

    ' Retrieve server res ponse using the GetChunk
    ' method when State = 12. This example assumes the
    ' data is text.
    Dim vtData as Variant ' Data variable.
    Dim intfile as Integer
    intfile = FreeFile()

    Select Case State
    ' ... Other cases not shown.
    Case icResponseCompleted ' 12
    ' Open a file to write to.
    Open "c:\txtOperation1.jpg" for binary Access _
    Write as #intfile

    ' get the first chunk. NOTE: specify a Byte
    ' array (icByteArray) to retrieve a binary file.
    vtData = Inet1.GetChunk(1024, icByteArray)

    Do While (len(vtData) > 0)
    Put #intfile, , vtData
    ' get next chunk.
    vtData = Inet1.GetChunk(1024, icByteArray)
    Loop
    Put #intfile, , vtData
    Close #intfile
    End Select
    Image1.Picture = LoadPicture("c:\txtoperation1.jpg")

    End Sub








Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured