laptop and a wrench

不具合

An error is not generated on a call to IFeature::Store when it should be.

最後に公開された状態: August 31, 2014 No Product Found
不具合 ID 番号 NIM088716
送信されましたFebruary 1, 2013
最終更新日April 2, 2025
適用対象No Product Found
見つかったバージョン10.1
プログラム言語C++
ステータスWill Not Be Addressed

参考情報

We apologize that we were unable to address this issue within the current product support cycle. If the issue continues to affect your work in a supported release, please contact Technical Support.

対処法

For this case an InsertCursor can be used in place of the IFeatureClass::CreateFeature...IFeature::Store workflow that is currently used in the sample code. int main( int argc, char* argv[] ){ std::string inputFileName = "<a href="file:X://testing3.gdb" target="_blank">X:\\testing3.gdb</a>"; std::string tableName = "Airspace"; std::string sdeFilePath = "<a href="file:C://Connection" target="_blank">C:\\Connection</a> to sql2008R2.sde"; std::string qualifiedTableName("loaded.DBO.AAA_POLYTEST_UNKNOWN"); HRESULT hr = S_OK; IAoInitializePtr ipInit = NULL; AoInitialize(NULL); hr = ipInit.CreateInstance( CLSID_AoInitialize ); if(FAILED(hr) || !ipInit) exit(-1); esriLicenseStatus license_status; ipInit->IsProductCodeAvailable( esriLicenseProductCodeAdvanced, &license_status ); if(license_status == esriLicenseAvailable) { esriLicenseStatus status = esriLicenseFailure; ipInit->Initialize(esriLicenseProductCodeAdvanced, &status ); if( status != esriLicenseCheckedOut ) throw std::string("Unable to get license"); } do { std::cout << "creating source workspace ..." << std::endl; IWorkspacePtr ipSrcWorkspace = NULL; if( FAILED( hr = createSourceWorkspace( ipSrcWorkspace, inputFileName ) ) ) break; IFeatureWorkspacePtr ipSrcFeatureWorkspace = ipSrcWorkspace; ITablePtr ipSrcTable = NULL; if( FAILED( hr = ipSrcFeatureWorkspace->OpenTable(CComBSTR(tableName.c_str()), &ipSrcTable ) ) ) break; ICursorPtr ipSrcCursor = NULL; if( FAILED( hr = ipSrcTable->Search( NULL, VARIANT_TRUE, &ipSrcCursor ) ) ) break; IFeatureCursorPtr ipSrcFeatureCursor = ipSrcCursor; std::cout << "creating destination workspace ..." << std::endl; IWorkspacePtr ipDstWorkspace = NULL; if( FAILED( createDestinationWorkspace( ipDstWorkspace, sdeFilePath) ) ) break; IFeatureWorkspacePtr ipDstFeatureWorkspace = ipDstWorkspace; ITablePtr ipDstTable = NULL; if( FAILED( hr = ipDstFeatureWorkspace->OpenTable( CComBSTR(qualifiedTableName.c_str()), &ipDstTable ) ) ) break; IFeatureClassPtr ipDstFeatureClass = ipDstTable; IWorkspaceEditPtr ipWorkspaceEdit = ipDstWorkspace; if( FAILED( hr = ipWorkspaceEdit->StartEditing(VARIANT_FALSE) ) ) break; if( FAILED( hr = ipWorkspaceEdit->StartEditOperation() ) ) break; IFeatureCursorPtr ipDstFeatureCursor = NULL; if( FAILED( hr = ipDstFeatureClass->Insert(VARIANT_TRUE, &ipDstFeatureCursor ) ) ) { std::cout << "failed to..." << std::endl; break; } std::cout << "Truncating table '" << qualifiedTableName << "' ... "; if( FAILED( hr = ipDstTable->DeleteSearchedRows(NULL) ) ) { std::cout << "failed to trunctate destination table - aborting" << std::endl; break; } std::cout << "Done" << std::endl; IVersionedObjectPtr ipVersionedObject = ipDstTable; if( ipVersionedObject ) { VARIANT_BOOL isVersioned = VARIANT_FALSE; if( SUCCEEDED( ipVersionedObject->get_IsRegisteredAsVersioned(&isVersioned) ) ) { if( !isVersioned ) { std::cout << "table is not versioned - aborting" << std::endl; break; } } } IFeaturePtr ipSrcFeature = NULL; for( int count = 1; true; ++count ) { hr = ipSrcFeatureCursor->NextFeature( &ipSrcFeature ); if( ipSrcFeature == NULL ) break; long objectID = NULL; ipSrcFeature->get_OID(&objectID); IGeometryPtr ipSrcGeometry = NULL; hr = ipSrcFeature->get_Shape( &ipSrcGeometry ); IFeatureBufferPtr ipDstFeatureBuffer = NULL; if( FAILED( hr = ipDstFeatureClass->CreateFeatureBuffer( &ipDstFeatureBuffer ) ) ) { std::cout << std::endl << "unable to create a feature class for output - aborting" << std::endl; return hr; } if( count == 4467 || count == 4524 ) { std::cout << std::endl << "about to store 'bad' feature with OBJECTID_1=" << count << std::endl; } hr = ipDstFeatureBuffer->putref_Shape(ipSrcGeometry); CComVariant id = NULL; if( FAILED( hr = ipDstFeatureCursor->InsertFeature(ipDstFeatureBuffer, &id) ) ) { std::cout << std::endl << "Store() failed with error code: " << hr << " with OBJECTID_1=" << objectID << std::endl; } if( count % 100 == 0 ) { ipDstFeatureCursor->Flush(); } } ipDstFeatureCursor->Flush(); if( FAILED( hr = ipWorkspaceEdit->StopEditOperation() ) ) { std::cout << std::endl << "STOP OP: " << hr << std::endl; break; } if( FAILED( hr = ipWorkspaceEdit->StopEditing( VARIANT_TRUE ) ) ) { std::cout << std::endl << "STOP EDIT: " << hr << std::endl; break; } } while( false ); if( hr != S_OK ) { std::cout << std::endl << "An error occurred with code:" << hr << std::endl; return hr; } ipInit = NULL; AoUninitialize(); return EXIT_SUCCESS;}

再現の手順

不具合 ID: NIM088716

ソフトウェア:

  • No Product Found

バグのステータスが変更されたときに通知を受け取る

Esri Support アプリのダウンロード

このトピックについてさらに調べる

ArcGIS エキスパートのサポートを受ける

テクニカル サポートへのお問い合わせ

Esri Support アプリのダウンロード

ダウンロード オプションに移動