is there an equlivant in vb.net

  • Thread starter Thread starter Brian
  • Start date Start date
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
 
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).
 
I am recieving a message telegram from another non windows system... I have
structures that i want to move the contents into.
 
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.
 
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.
 
Back
Top