Im using an OCX in my C# application. It's triggering an event of this signature:
private void GetData(int size, byte pData)
the orignal signature in c++ before it was compiled:
HRESULT GetData(int size, BYTE* pData);
The documentation says that the pData is a pointer to allocated memory holding the data packet (most probably a bitmap object in my case).
I have tried this to get the data:
byte[] bytes = new byte[size];
Marshal.Copy(ne w IntPtr((int)e.p Data), bytes, 0, size); // AccessViolation exception (Attempted to read or write...)
Anyone with better idea?
Thanks in advance.
regards,
gudguy
private void GetData(int size, byte pData)
the orignal signature in c++ before it was compiled:
HRESULT GetData(int size, BYTE* pData);
The documentation says that the pData is a pointer to allocated memory holding the data packet (most probably a bitmap object in my case).
I have tried this to get the data:
byte[] bytes = new byte[size];
Marshal.Copy(ne w IntPtr((int)e.p Data), bytes, 0, size); // AccessViolation exception (Attempted to read or write...)
Anyone with better idea?
Thanks in advance.
regards,
gudguy