i have been trying to upgrade the VB6 project that can be found at
http://www.vbaccelerator.com/home/VB/Code/vbMedia/Audio/WAV_File_Viewer/article.asp
I have managed to get the majority done, using a combination of the upgrade
facility and some programming of my own. I have now unfortantly got stuck
with the following line of code:
copymemory(VarPtrArray(iWav), VarPtr(tSA), 4)
(copymemory being the standard API call to RtlMOveMemory in kernel32)
The problem i have is the VarPtr command, and to some extent the VarPtrArray
command. I need a solution for VBnet.
Background information:
tSA is variable of the following structure:
_
Private Structure SAFEARRAYBOUND
Dim cElements As Integer
Dim lLbound As Integer
End Structure
_
Private Structure SAFEARRAY2D
Dim cDims As Short
Dim fFeatures As Short
Dim cbElements As Integer
Dim cLocks As Integer
Dim pvData As Integer
Dim BoundsR() As SAFEARRAYBOUND
Public Sub Init()
ReDim BoundsR(1)
End Sub
End Structure
and is created just before the copymemory line by
Dim tSA As SAFEARRAY2D
tSA.Init()
and propulated with
With tSA
.cbElements = 2
.cDims = 2
.BoundsR(0).lLbound = 0
.BoundsR(0).cElements = m_cWAVRead.ReadbufferSize
.BoundsR(1).lLbound = 0
.BoundsR(1).cElements = 2
End With
iwav is created in the following method
Dim iWav() As Short
If you need any more information please email me at
[email protected] (please remove the nospam)
or reply to the post. I have both the orignal VB6 project, the VBnet project
created using the upgrade wizard and my
own semi working version.
Thanks for any help provided
Adrian