libwebp in VB 6.0 programs.

5 views
Skip to first unread message

Александр Рощупкин

unread,
4:49 AM (14 hours ago) 4:49 AM
to WebP Discussion
Hello!
I want to use part of the libwebp library to view images in a program written in VB 6.0 on 32-bit systems (Windows XP x86).
I've declared declarations for two library functions:
Public Declare Function WebPGetDecoderVersion Lib "libwebp.dll" () As Long
Public Declare Function WebPGetInfo Lib "libwebp.dll" (ByRef Arr As Any, _
ByVal data_size As Long, ByRef Wwidth As Long, _
ByRef Wheight As Long) As Long
The first function works fine when called:
Label4.Caption = WebPGetDecoderVersion
The second function, when called:
Addr = WebPGetInfo(bRead(0), FSize - 1, ImgW, ImgH)
raises an error: "Bad DLL calling convention".
I tried compiling the parts I needed from the libwebp library. The decode.h file contains prototypes of the functions I need, but I couldn't find the functions themselves.
What should I do to find them?

James Zern

unread,
4:13 PM (3 hours ago) 4:13 PM
to webp-d...@webmproject.org
Hi,

On Wed, Oct 22, 2025 at 1:49 AM Александр Рощупкин <arosch...@gmail.com> wrote:
Hello!
I want to use part of the libwebp library to view images in a program written in VB 6.0 on 32-bit systems (Windows XP x86).
I've declared declarations for two library functions:
Public Declare Function WebPGetDecoderVersion Lib "libwebp.dll" () As Long
Public Declare Function WebPGetInfo Lib "libwebp.dll" (ByRef Arr As Any, _
ByVal data_size As Long, ByRef Wwidth As Long, _
ByRef Wheight As Long) As Long 
The first function works fine when called:
Label4.Caption = WebPGetDecoderVersion
The second function, when called:
Addr = WebPGetInfo(bRead(0), FSize - 1, ImgW, ImgH)
raises an error: "Bad DLL calling convention".

https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/error-messages/bad-dll-calling-convention has some guidance around this error. I'm not sure if the types are aligned correctly, but haven't tried this myself.
 
I tried compiling the parts I needed from the libwebp library. The decode.h file contains prototypes of the functions I need, but I couldn't find the functions themselves.
What should I do to find them?

If you're working from a git repository, you can use `git grep WebPGetInfo`. Otherwise something like `grep -R WebPGetInfo` can work. This function is defined in src/dec/webp_dec.c:
 

--
You received this message because you are subscribed to the Google Groups "WebP Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webp-discuss...@webmproject.org.
To view this discussion visit https://groups.google.com/a/webmproject.org/d/msgid/webp-discuss/e84dd7a0-c21c-48a1-80fa-6e24fda875a0n%40webmproject.org.
Reply all
Reply to author
Forward
0 new messages