In Focus

Forums - C# Corner

Forum guidelines

CopyMemory in C#

Oct 9 2008 10:11 AM

Hello, I am trying to convert an existing VB program to 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)


Build smarter apps with Machine Learning, Bots, Cognitive Services - Start free.

Start Learning Now