.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 10th, 2005, 05:49 PM
Quenchmaster Quenchmaster is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Location: Coventry, England
Posts: 1 Quenchmaster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 m 42 sec
Reputation Power: 0
Exclamation Help Required Upgrading VB6 project to VB Net -> specifically VarPtr solution

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)
(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:
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
and is created just before the copymemory line by

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
iwav is created in the following method
Code:
Dim iWav() As Short
If you need any more information please email me at
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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > Help Required Upgrading VB6 project to VB Net -> specifically VarPtr solution


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT