tags:

views:

24

answers:

1

I am embedding the ESRI Map Control into a custom ActiveX control written in MFC/C++. The custom ActiveX control serves as a Map Control wrapper so I can embed it into a specific environment that is runtime only and non-relational. Thanks to this site, I am able to load feature points into an in-memory workspace. However, the hosting environment now gets stuck in memory when closed, and it only does this when I am using the InMemoryWorkspaceFactory. My conclusion, therefore, is that the factory has locked a file or resource and, by not releasing it, is causing the host environment to never close.

Is there a way I can manually delete all features and feature classes during my ActiveX control's WM_DESTROY message and release the workspace completely? There doesn't seem to be a counterpart to the IWorkspaceFactory's Create method. My code is releasing all interfaces to the workspace factory, but apparently there are still references internally in ArcObjects.

A: 

I discovered the answer to my question. It wasn't the in-memory workspace that needed to be closed, it was ArcObjects in general. The solution is to make sure to call the Shutdown method of the IAoInitialize interface during the WM_DESTROY message.

KRFournier