|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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: Code:
copymemory(VarPtrArray(iWav), VarPtr(tSA), 4) 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: Code:
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi)> _ Private Structure SAFEARRAYBOUND Dim cElements As Integer Dim lLbound As Integer End Structure <StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi)> _ Private Structure SAFEARRAY2D Dim cDims As Short Dim fFeatures As Short Dim cbElements As Integer Dim cLocks As Integer Dim pvData As Integer <VBFixedArray(1)> Dim BoundsR() As SAFEARRAYBOUND Public Sub Init() ReDim BoundsR(1) End Sub End Structure Code:
Dim tSA As SAFEARRAY2D tSA.Init() and propulated with Code:
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 Code:
Dim iWav() As Short adrian.game@nospamWarwick.ac.uk (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 |
![]() |
| Viewing: Dev Articles Community Forums > Programming > .NET Development > Help Required Upgrading VB6 project to VB Net -> specifically VarPtr solution |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|