Pls help me in VB.net regarding API

S

simran

Hi !!1

I am making on application to contl the volume similar to
sndvol32.exe . I got the some code in VB6. I am working in VB.NET so i
ma trying to convert that ocde in VB.NET
In VB6 i have these two functions in which they have used " As Any" I
know that in VB.NET this is not supported but i am not able to find
wht will i use insted of that in the declarations part.



Declare Sub CopyStructFromPtr Lib "kernel32" Alias "RtlMoveMemory"
(ByRef struct As any, ByVal ptr As Integer, ByVal cb As Integer)

'
Declare Sub CopyPtrFromStruct Lib "kernel32" Alias "RtlMoveMemory"
(ByVal ptr As Integer, ByRef struct As Any , ByVal cb As Integer)


Can anyone pls let me know wht to do in this case in case of VB.NET

Once i will make this one i iwll post the code so that everyone will
get benefit


simu
 
A

Anon-E-Moose

(e-mail address removed) (simran) wrote in
Declare Sub CopyStructFromPtr Lib "kernel32" Alias "RtlMoveMemory"
(ByRef struct As any, ByVal ptr As Integer, ByVal cb As Integer)

'
Declare Sub CopyPtrFromStruct Lib "kernel32" Alias "RtlMoveMemory"
(ByVal ptr As Integer, ByRef struct As Any , ByVal cb As Integer)



If you look at the Kernel32 API, the first two parameters are just pointers
to objects.

http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/kmarch/hh/kmarch/k109_5731ba5b-a7a5-4883-87cf-543768a29a93.xml.asp

So I assume you can either pass in a pointer, structure, or object.

Do you have a specific structure to use?
 
K

Ken Tucker [MVP]

Hi,

Take a look at the marshal.ptrtostructure and marshal.structuretoptr
methods.

http://msdn.microsoft.com/library/d...opservicesmarshalclassptrtostructuretopic.asp

http://msdn.microsoft.com/library/d...opservicesmarshalclassstructuretoptrtopic.asp

Ken
---------------------
Hi !!1

I am making on application to contl the volume similar to
sndvol32.exe . I got the some code in VB6. I am working in VB.NET so i
ma trying to convert that ocde in VB.NET
In VB6 i have these two functions in which they have used " As Any" I
know that in VB.NET this is not supported but i am not able to find
wht will i use insted of that in the declarations part.



Declare Sub CopyStructFromPtr Lib "kernel32" Alias "RtlMoveMemory"
(ByRef struct As any, ByVal ptr As Integer, ByVal cb As Integer)

'
Declare Sub CopyPtrFromStruct Lib "kernel32" Alias "RtlMoveMemory"
(ByVal ptr As Integer, ByRef struct As Any , ByVal cb As Integer)


Can anyone pls let me know wht to do in this case in case of VB.NET

Once i will make this one i iwll post the code so that everyone will
get benefit


simu
 
S

simran

ken!!1
Hi!!1
thnaks for that...
but still my problme is not yet solved.
although i have seen the sites which u have told but still i ma not
able to get.........
I am gone mad by going through all ten suff and trying alot but still
nothing seems to come
out.................................................

wht will i do ...
????

Can anyone tell me how is there any other api with whoich i can make
that application

simu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top