You are here: > ESRI Forums > arcgis engine forums > Thread Replies

ArcGIS Engine Forums

ArcGIS Engine: Developer Kit forum

Are "put_value" and "store" not members of...   Morad FARIS Mar 04, 2009
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Are "put_value" and "store" not members of 'IFeature' in a MFC project !!!!???? 
Author Morad FARIS 
Date Mar 04, 2009 
Message Hi developers,

I added those functions "pFeature.put_value(index,&data) and pFeature.store()" in an exiting Atl application sample ( "BrowseData" a sample delivred with ArcGIS engine Developper Kit 9.2) so its work very well. However, when i start with a new MFC project or MFC project supporting Atl, the compiler display an error that "put_value" and "store" are not methods of IFeature.

: error C2039: 'put_Value' : is not a member of 'IFeature'

: see declaration of 'IFeature'

: error C2039: 'Store' : is not a member of 'IFeature'

: see declaration of 'IFeature'



Help please !!

Thank you very much
 
 
// AtlDLG.cpp : implémentation de CAtlDLG "this is an Atl class inserted in an MFC project 

#include "stdafx.h"
#include "AtlDLG.h"
#include "Shlobj.h"


LRESULT CBrowse::OnAdd(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
	LRESULT hr;

 IWorkspaceFactoryPtr ipShapeFileFactory(CLSID_ShapefileWorkspaceFactory);
 IWorkspacePtr ipWorkspace;

  ipShapeFileFactory->OpenFromFile(bstrWorkspacePath, 0, &ipWorkspace);

  IFeatureWorkspacePtr ipFeatureWksp(ipWorkspace);

  IFeatureClass *ipFeatureClass;
	
ipFeatureWksp->OpenFeatureClass(bstrFeatureClassName, &ipFeatureClass);
  

 ////////////****** Find Field index *********** 

   IFieldsPtr ipFields;

	ipFeatureClass->get_Fields(&ipFields);
		
	long ind;
	
        ipFields->FindField(L"GenVor", &ind);
	
      	
//////////// ******** Put value at field(index) of all features ******* ///////
	
	long ipNumFeatures;
	IFeature *ipFeature;
	ipFeatureClass->FeatureCount(0,&ipNumFeatures);

	
		
	for(long i=0; i< ipNumFeatures; i++)
	{
		
ipFeatureClass->GetFeature(i,&ipFeature);
		
		VARIANT ipValue;
		
		::VariantInit(&ipValue);

		ipValue.vt=VT_BSTR;
		
		CComBSTR Data= L"MyData";
		
		ipValue.bstrVal = Data;

hr= ipFeature->put_Value(ind, ipValue);
		
			
hr = ipFeature->Store();

		
	
	}

	return hr;
}