阅读:1616回复:1
请教一个vc+ao三维显示的一个问题
<P>加载点类型的Feature class数据时总出错,这个数据是用来生成RASTER的源数据。调试无错误(第一行代码就有问题,由于是新手,不知道该如何继续)代码如下: </P>
<P>void CDlgCreateRasterIDW::OnButtonIdwAddpointlayer() <BR>{<BR> //打开对话框<BR> IGxDialogPtr ipGxDialog(CLSID_GxDialog);<BR> IGxObjectFilterPtr ipGxObjectFilter(CLSID_GxFilterPointFeatureClasses);<BR> ////注意:这里使用了GxFilterPointFeatureClasses,<BR> ////可以过滤点特征集,满足功能只用点内插的需要<BR> HRESULT hr=ipGxDialog->putref_ObjectFilter(ipGxObjectFilter);<BR> if(FAILED(hr)) return;<BR> hr=ipGxDialog->put_Title(CComBSTR("选择一个点数据集"));<BR> if(FAILED(hr)) return;<BR> IEnumGxObjectPtr ipEnumGxObject;<BR> VARIANT_BOOL bResult;</P> <P> hr=ipGxDialog->DoModalOpen(0,;ipEnumGxObject,;bResult);<BR> if(FAILED(hr)) return;<BR> <BR> if(bResult==VARIANT_FALSE) return;<BR> <BR> hr=ipEnumGxObject->Reset();<BR> if(FAILED(hr)) return;<BR> <BR> IGxObjectPtr ipGxObject;<BR> while(!ipEnumGxObject->Next(;ipGxObject))<BR> {<BR> IGxDatasetPtr ipGxDataset(ipGxObject);<BR> if(ipGxDataset!=0)<BR> {<BR> IDatasetPtr ipDataset;<BR> hr=ipGxDataset->get_Dataset(;ipDataset);<BR> if(FAILED(hr)) return;<BR> IFeatureClassPtr ipFeatureClass(ipDataset);<BR> m_ipfeat=ipFeatureClass;</P> <P> CComBSTR bstrName;//获得输入点层的全名<BR> ipGxObject->get_FullName(;bstrName);<BR> CString str(bstrName);<BR> m_edit_IDWPointInput=str;<BR> <BR> UpdateData(FALSE);</P> <P> //将点层ipFeatureClass的所有字段添加到combo box控件列表中<BR> m_combo_IDWZvalueField.ResetContent(); //先清空</P> <P> HRESULT hr;<BR> long lFieldCount;<BR> IFieldsPtr pFClassPointFields;<BR> ipFeatureClass->get_Fields(;pFClassPointFields);<BR> pFClassPointFields->get_FieldCount(;lFieldCount);<BR> for(int i=0;i<lFieldCount;i++)<BR> {<BR> CComBSTR pname;<BR> IFieldPtr pField;<BR> hr=pFClassPointFields->get_Field(i,;pField);<BR> if(FAILED(hr)) return;<BR> hr=pField->get_Name(;pname);<BR> if(FAILED(hr)) return;<BR> CString ppname(pname);<BR> m_combo_IDWZvalueField.AddString(ppname);<BR> }<BR> m_combo_IDWZvalueField.SetCurSel(0);//初始化显示comboBox</P> <P> }<BR> }</P> <P>}</P> <P><v:shapetype> <v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path connecttype="rect" gradientshapeok="t" extrusionok="f"></v:path><lock aspectratio="t" v:ext="edit"></lock></v:shapetype><v:shape><v:imagedata></v:imagedata></v:shape></P> |
|
1楼#
发布于:2006-09-27 15:27
就是调用系统对话框出错,怎么回事? 急
|
|