I have a customer/partner who's trying to link their application with ours using our exposed COM functionality. So far, they've got a COM object which represents an instance of our software package and then use our COM methods to programmatically build something up for the user based on what they've done in their application. It's essentially an "export" feature.
What they've asked me to do, which I can't work out how to do is to allow the user to decide when the instance is closed. What I mean by this is when our software package is loaded up, it's viewable and is interacted with by the user. When they are finished they'd naturally click the cross at the top right to exit the software. This doesn't work as the COM object is still "active" in their application. Our software package can only be closed by killing the process in task manager whilst the application that loaded it via COM remains open. Once their application exits, ours will automatically close. It seems as if their application "owns" ours because of the COM call.
I've made a quick demo app in C# to try using things like Marshal.FinalReleaseComObject(myObject) to no avail.
I realise that using COM for this kind of thing isn't really what it is intended for, but hopefully there's some sort of workaround? The customer/partner is using VB.NET but C# is fine.
Form.Closing Eventand setting some status.