(ATL) COM dll heap vs CRT heap 
Author Message
 (ATL) COM dll heap vs CRT heap

Hello All

I've created a COM dll. Now i'm trying to use a another non-COM dll from it.
It works fine, untill i try to return a string from the dll. Apprently the
problem is due to different heaps, (Heap assertion) COM heap vs. CRT heap.
Now how can I make this two f****s work together?

Thanks,
Sami



Thu, 25 Nov 2004 00:43:57 GMT  
 (ATL) COM dll heap vs CRT heap
Hi

From what I understand, you are trying to release memory allocated by your
non-COM DLL from your COM DLL.

If that memory was allocated from the CRT Heap you must release it from that
same heap.  You can do that if you define and export a function from your
non-COM DLL to release that memory.

The Win32API uses the same technique when working with the Shell it exposes
the IMalloc interface to allow us to do the same kind of work.

Dick Murillo


Quote:
> Hello All

> I've created a COM dll. Now i'm trying to use a another non-COM dll from
it.
> It works fine, untill i try to return a string from the dll. Apprently the
> problem is due to different heaps, (Heap assertion) COM heap vs. CRT heap.
> Now how can I make this two f****s work together?

> Thanks,
> Sami



Thu, 25 Nov 2004 07:04:13 GMT  
 (ATL) COM dll heap vs CRT heap
Thanks for the info.

Sami


Quote:
> Hi

> From what I understand, you are trying to release memory allocated by your
> non-COM DLL from your COM DLL.

> If that memory was allocated from the CRT Heap you must release it from
that
> same heap.  You can do that if you define and export a function from your
> non-COM DLL to release that memory.

> The Win32API uses the same technique when working with the Shell it
exposes
> the IMalloc interface to allow us to do the same kind of work.

>{*filter*} Murillo



> > Hello All

> > I've created a COM dll. Now i'm trying to use a another non-COM dll from
> it.
> > It works fine, untill i try to return a string from the dll. Apprently
the
> > problem is due to different heaps, (Heap assertion) COM heap vs. CRT
heap.
> > Now how can I make this two f****s work together?

> > Thanks,
> > Sami



Thu, 25 Nov 2004 22:28:45 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. HEAP[dllhost.exe]: HEAP: Free Heap block 1e32c28 modified at 1e32dc4 after it was freed

2. CRT heap, debug configurations, and WS2_32.DLL

3. Heap Problems: Both Debug and non-Debug versions of CRT are active

4. Binomial heaps / Fibonacci heaps

5. HEAP error: Free heap block xxx mdofied at xxx

6. Invalid heap signature for heap

7. Heap errors when stressing Automation, _bstr_t, and watching heap blocks

8. Decoding a .bmp image from heap to heap

9. Heap Usage problem with ATL exe - VC 5.0/ATL 2.1

10. C1060: compiler is out of heap space with VS.NET 2003 RC1

11. Performance problems with VS.net and heap data

12. Newbie Question - Stack vs Heap

 

 
Powered by phpBB® Forum Software