Results 1 to 7 of 7

Thread: vbLibCurl

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2015
    Posts
    1,055

    vbLibCurl

    Did a little more work around Jeffrey Phillips 2005 vblibcurl

    - initLib() to find/load C dll dependencies on the fly from different paths
    - removed tlb requirements (all enums covered but not all api declares written yet)
    - added higher level framework around low level api
    - file progress, response object, abort
    - download to memory only or file
    - file downloads do not touch cache or temp
    - easy access to add headers, form elements, file uploads, version info
    - runs on win2k and newer

    You will still need the 2 open source standard C dlls: libcurl.dll, vblibcurl.dll

    https://sourceforge.net/projects/lib...url.vb%201.01/

    still more that could be done/cleaned up but this is all i need for now
    and my keystrokes are limited

    edit:
    for it to work with newer ssl servers you will need to update the 15yr old libcurl.dll.
    Its just a drop in replacement. grab the 32 bit version: https://curl.se/windows/
    You will also need the matching 32 bit openssl libaries: https://curl.se/windows/dl-7.73.0_1/...in32-mingw.zip
    Newer version requires XP SP2 or newer (normaliz.Idn2Ascii, and Kernel32.ConvertFiberToThread in openssl)

    edit 2:
    vb's built in Put file write command has a 2gb file size limit. I will leave it to the reader to switch over to API file writes if you need it.

    edit 3: 11.17.20
    added support for adding headers, POST form elements/file uploads, version api strings
    Attached Files Attached Files
    Last edited by dz32; May 15th, 2023 at 09:19 PM.

  2. #2
    Hyperactive Member
    Join Date
    Jun 2016
    Location
    España
    Posts
    506

    Re: vbLibCurl

    Very good contribution.
    has some limitation when downloading files.
    why to do the test, download an iso of ubuntu 2.5 Gb and only 450Mb have been downloaded

    Greetings

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2015
    Posts
    1,055

    Re: vbLibCurl

    thanks for the bug report

    the first problem was that CURLOPT_TIMEOUT is the total download time to abort if exceeded (was set at 15 seconds)
    switched to CURLOPT_CONNECTTIMEOUT and made the totalTimeout clear w/default as infinite. zip updated.

    still having a problem when download size hits the 2gb mark, even with progress code disabled and switching BytesReceived to double.
    I had not tested on giant files.

    I'll poke around more later. Bug might be in the vblibcurl.dll
    Last edited by dz32; Nov 14th, 2020 at 05:54 AM.

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2015
    Posts
    1,055

    Re: vbLibCurl

    so the vb put command throws bad record number once the file size hits 2gb.
    you would have to switch over to api file writes for downloads > 2gb
    I will leave that as exercise for those who might need it.
    Last edited by dz32; Nov 14th, 2020 at 05:55 AM.

  5. #5
    New Member
    Join Date
    May 2020
    Posts
    7

    Re: vbLibCurl

    I just download libcurl (https://curl.se/windows/), It includes the "libcurl.dll", in which to reference when using it. I open my project, try to add a reference to the DLL, and get "Can't add a reference to the specified file". Any idea what this means, and what's going wrong? Thanks.

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2015
    Posts
    1,055

    Re: vbLibCurl

    the add reference mechanism is for ActiveX dlls. These dlls are standard C dlls like the kernel32 Windows API dll

    standard dlls are most commonly utilized by vb6 through the api declare mechanism.

    The declares for the vblibcurl.dll (which is required) are in modDeclaresNoTlb.bas after the enums

    we do not use the libcurl.dll directly from vb, but through the intermediate vblibcurl.dll

  7. #7
    Hyperactive Member
    Join Date
    Jun 2016
    Location
    España
    Posts
    506

    Re: vbLibCurl

    very good work.
    my knowledge is very limited.
    But it works perfectly for me. I don't think I have to download such large files in my projects, just the ubuntu iso was a test.

    Greetings

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