15
Answers

CopyMemory in C#

Darren Formosa

Darren Formosa

16y
21.5k
1

Hello, I am trying to convert an existing VB program to C#.net and am having problems with CopyMemory.  The program I am writing is a DLL which plugs in to 3rd party program (which is working), however, I need access to an array of numbers which is passed to the routine but it is passed as a double so I belive it is the memory location of the required array.  This has been done in VB by calling CopyMemory (Options(0), narray, 40) where:- Options(0 to 4) as Double and narray is the double passed from the program to the routine.

Does anyone know how CopyMemory works or how I can convert a double to IntPtr so I can use CopyMemory in C#?

Any suggestion would be grateful.


Answers (15)