Welcome Guest ( Log In | Register )

Calling wavpackdll.dll from VB
post Oct 13 2009, 20:05
Post #1

Group: Members
Posts: 63
Joined: 13-October 09
Member No.: 73985

I have created a simple audio program with Visual basic 6 and would like to include Wavpack support, specifically the decoding functions. I keep getting a “Bad dll calling convention” error when I try to call the WavpackOpenFileInput function.

VB Declare statement
Private Declare Function WavpackOpenFileInput Lib "wavpackdll.dll" ( _
                     ByVal infilename As String, _
                     ByVal error As String, _
                     ByVal Flags As Long, _
                     ByVal norm_offset As Long) As Long

Calling fuinction
Public Function WaveUnpack(WavPackFileSpec As String) As Boolean

Dim WavpackContext   As Long
Dim ErrorString      As String
Dim Flags1           As Long
Dim norm_offset      As Long

Flags1 = 0
norm_offset = 0
ErrorString = Space(80)

WavpackContext = WavpackOpenFileInput(WavPackFileSpec, ErrorString, Flags1, norm_offset)

End Function

Any help please

Microsoft Visual Basisc 6.0 (SP6)
Microsoft XP SP2
Go to the top of the page
+Quote Post
Start new topic
post Oct 14 2009, 11:35
Post #2

Group: FB2K Moderator
Posts: 2359
Joined: 30-November 07
Member No.: 49158

I assume it's because VB can call only functions using stdcall calling convention. The WavPack library apparently uses C-calling convention (cdecl).
See google.com/search?q=call+cdecl+dll+function+visual+basic for workarounds.

Full-quoting makes you scroll past the same junk over and over.
Go to the top of the page
+Quote Post

Posts in this topic

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 30th November 2015 - 08:24