ArcEngine 释放对象

释放对象 例如IFeatureCursor,IFeatureClass等

ESRI.ArcGIS.ADF.ComReleaser.ReleaseCOMObject(myFeatureCursor);

打开的Shape文件等把解锁,也就是把.lock文件去掉。

public static void ReleaseFeatureClass(IFeatureClass pFeatureClass)
{
IWorkspace myWorkspace = (pFeatureClass as IDataset).Workspace;
IWorkspaceFactory myWorkspaceFactory = myWorkspace.WorkspaceFactory;
ESRI.ArcGIS.ADF.ComReleaser.ReleaseCOMObject(pFeatureClass);
IWorkspaceFactoryLockControl myWorkspaceFactoryLockControl = myWorkspaceFactory as IWorkspaceFactoryLockControl;
if (myWorkspaceFactoryLockControl.SchemaLockingEnabled)
{
myWorkspaceFactoryLockControl.DisableSchemaLocking();
}
}

上一篇:ArcEngine代码 浏览器端图形JSON与后端IGeometry相互转换


下一篇:ArcEngine打开GDB,SHP的方法