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();
}
}
标签:释放,pFeatureClass,对象,myWorkspaceFactoryLockControl,ReleaseCOMObject,myWorkspaceFa 来源: https://www.cnblogs.com/mytudousi/p/14344517.html