Convert IntPtr to Dword array using Marshal.

P

Piotrekk

Hi

I have an dword array returned by send message with TBM_GETPTICS
Message.
Thus i need to convert IntPtr to managed block of memory ( Int32
because od dword ).

I tried saveral ways but it doesnt work:


IntPtr ar = SendMessage(new
HandleRef(trackBar1,trackBar1.Handle), 1038, new IntPtr(0), new
IntPtr(0));

Int32[] array = new Int32[200];
Type asd = array.GetType();
object sss = (Int32 [] )Marshal.PtrToStructure(ar,asd);

I would be grateful for help
PK
 

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