VB6からC++ COM DLLを呼び出そうとしています。間違ったDLL呼び出し規約
C++のコードは次のとおりです。
STDMETHODIMP CSonic::sonicChangeShortSpeed(
SHORT* samples,
LONG *numSamples,
FLOAT speed,
FLOAT pitch,
FLOAT rate,
FLOAT volume,
LONG useChordPitch,
LONG sampleRate,
LONG numChannels
)
私はこのようVB6からそれを呼び出す:私のコードでは
Private Declare Function sonicChangeShortSpeed Lib "SonicLIB.dll" Alias "#1" (
ByRef samples As Integer,
ByRef numSamples As Long,
ByVal speed As Double,
ByVal pitch As Double,
ByVal rate As Double,
ByVal volume As Double,
ByVal useChordPitch As Long,
ByVal sampleRate As Long,
ByVal numChannels As Long)
As Long
、私が使用:
Dim nIntegers() As Integer
ReDim nIntegers(2047)
Dim lSamples As Long
Dim dblSpeed As Double
Dim dblPitch As Double
Dim dblRate As Double
Dim dblVol As Double
Dim lUseChordPitch As Long
Dim lSampleRate As Long
Dim lNumChannels As Long
lSamples = 2048
dblSpeed = 0.5
dblPitch = 0
dblRate = 1
dblVol = 1
lUseChordPitch = 1
lSampleRate = 48000
lNumChannels = 1
Dim lRet As Long
lRet = sonicChangeShortSpeed(nIntegers(0), lSamples, dblSpeed, dblPitch, dblRate, dblVol, lUseChordPitch, lSampleRate, lNumChannels)
最後の行が生成します"間違った呼び出し規約"エラー。
誰かが私の間違いを見ますか?
ありがとうございました!
COMを使用してCOM DLLを呼び出すことはありません。 –
@Noodlesどういう意味ですか? – tmighty
これはCOMコールです。 'Set X = CreateObject(" Application.Object "):msgbox x.sonicChangeShortSpeed(nIntegers(0)、lSamples、dblSpeed、dblPitch、dblRate、dblVol、lUseChordPitch、lSampleRate、lNumChannels)' –