I have an managed .NET 2.0 dll that provides an IDispatch inteface and calls an IDispatch interface. Reading this question this question:
When to use ReleaseComObject vs FinalReleaseComObject?
It sounds as though I should be waiting for Garbage Collection to release my COM object references rather than attempting to count them myself. However when I do this, the unmanaged code calling my DLL throws an error (I don't have the source code to debug what the error is) but it indicates it's an unauthorized virtual memory access problem. Adding the FinalReleaseCOMObject stops this error.
Should I be using FinalReleaseCOMObject then?
EDIT: forgot to mention when the managed code is replaced by an unmanaged dll it does not exhibit the error.