![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I am using a COM component which provides a function like GetBitmapData(out BYTE* pData, out long *pLen), in which it allocates the memory using "new" and returns the pointer and length of memory block. i am calling this functon in C# in following way... int pImageBuffer = 0; int len = 0; m_COMAdapter.GetBitmapData(ref pImageBuffer, out len); IntPtr ImageData = new IntPtr(pImageBuffer); //I use IntPtr //Now I need to free up the memory allocated by GetBitmapData() I am not sure how i can free up the memory here? I tried Marshal.FreeCoTaskMem(ImageData), but its not helping and i am sure if it is the correct way... thx, m... |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |