is there an equlivant in vb.net

B

Brian

I used an api call in vb 6 and was wondering if there was a vb.net method or
would I continue to use the api call
public declare sub Copymemory lib "kernel32" alias "RtlMoveMemory"
(destination as any, source as any, byval length as long)

thanks Brian
 
T

Tom Shelton

I used an api call in vb 6 and was wondering if there was a vb.net method or
would I continue to use the api call
public declare sub Copymemory lib "kernel32" alias "RtlMoveMemory"
(destination as any, source as any, byval length as long)

thanks Brian

Depends... But, the fact is you almost NEVER need to use RtlMoveMemory in
..NET - in fact, unless you know what your doing you shouldn't as it can be
dangerous because of the way the runtime manages the heap (objects can and do
relocate on the heap).

My suggestion is to post what you are trying to accomplish with RtlMoveMemory
- and then it will be much easier to direct you to the proper way to implement
what your trying to do (or show you how to use rtlmovememory if the
circumstances call for it).
 
B

Brian

I am recieving a message telegram from another non windows system... I have
structures that i want to move the contents into.
 
T

Tom Shelton

I am recieving a message telegram from another non windows system... I have
structures that i want to move the contents into.

What form are you receiving the messages (byte arrays)? what protocol?
tcpip? what do you structures look like, etc, etc. A little more context is
needed.
 
H

Herfried K. Wagner [MVP]

Brian said:
I used an api call in vb 6 and was wondering if there was a vb.net method or
would I continue to use the api call
public declare sub Copymemory lib "kernel32" alias "RtlMoveMemory"
(destination as any, source as any, byval length as long)

'System.Runtime.InteropServices.Marshal' provides some methods to copy
binary data and to fill structures. However, if these methods are
suitable depends on your exact scenario.
 

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