POST
|
Thanks for reply, The problem is happening in ArcMap however I need to fix it with the ArcEngine. I've been trying to read the OperationStack property but the value is null. Do you have any other idea? But the way I'm testing the following code (which is not working :()
ILayer layer = (ILayer) m_mapControl.CustomProperty;
// m_mapControl.Map.DeleteLayer(layer);
IFeatureLayer pFeaLayer = (IFeatureLayer)layer;
IFeatureClass pFeaClass = pFeaLayer.FeatureClass;
IDataset pFCDataset = (IDataset)pFeaClass;
IWorkspace pWorkspace = pFCDataset.Workspace;
IDataset pWsDataset = (IDataset)pWorkspace;
while (System.Runtime.InteropServices.Marshal.ReleaseComObject(pFeaClass) > 0) { };
//disconnect and delete the layer from the map
IDataLayer2 dl = (IDataLayer2)pFeaLayer;
dl.Disconnect();
m_mapControl.Map.DeleteLayer(layer);
while (System.Runtime.InteropServices.Marshal.ReleaseComObject(pFeaLayer) > 0) { };
layer = null;
System.GC.Collect(); Thanks. Gustavo.
... View more
07-19-2011
12:32 PM
|
0
|
0
|
456
|
POST
|
Thanks for response, I've tried disconnecting the layer, but It didn't work. IDataLayer2 dl = (IDataLayer2)pFeaLayer;
dl.Disconnect();
m_mapControl.Map.DeleteLayer(layer);
while (System.Runtime.InteropServices.Marshal.ReleaseComObject(pFeaLayer) > 0) { }; I've made some tests into the ArcMap and it's happen the same problem. I think this is an ESRI issue. Thanks.
... View more
07-19-2011
10:13 AM
|
0
|
0
|
456
|
POST
|
Hi All, I've been trying to delete the layer from the map and release the memory but I was not able to find the solution. I'm using the following code to remove the layer from the Map. ILayer layer = (ILayer) m_mapControl.CustomProperty;
m_mapControl.Map.DeleteLayer(layer); This code is working however the memory is not released. Does anyone know how can I release the memory? This is a big problem because when I add a lot of layer to the TOC and then I remove them the application does not release the memory.
... View more
07-19-2011
06:17 AM
|
0
|
9
|
1267
|
POST
|
Hi All, I've created a AxToolbarControl which contains some commands. I need to hide or disable some command on this toolbar. However, I was not able to find the way to do that. Does anyone know how to do that (disable a tool bar item)? Thanks in advance. Gustavo.
... View more
05-28-2010
10:41 AM
|
0
|
1
|
498
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|