42261300
路人甲
路人甲
  • 注册日期2006-06-09
  • 发帖数2
  • QQ
  • 铜币112枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1027回复:1

[原创]求救?在vc里创建要素失败,请大家分析

楼主#
更多 发布于:2007-07-09 19:32
<P> IWorkspaceEditPtr pWorkspaceEdit;<BR> IDatasetPtr data;<BR> IWorkspacePtr  ipwork;<BR> data=pFeatureClass;<BR> data->get_Workspace(;ipwork);<BR>  pWorkspaceEdit=ipwork;</P>

<P>///////////////////////////////////////////////////////////</P>
<P>    HRESULT hr = pWorkspaceEdit->StartEditing(FALSE);<BR> if (FAILED(hr))<BR> {<BR>  AfxMessageBox("开始编辑失败!" );<BR>  pWorkspaceEdit->AbortEditOperation();<BR>  return FALSE;<BR> }<BR> hr = pWorkspaceEdit->StartEditOperation();<BR> if (FAILED(hr))<BR> {<BR>  AfxMessageBox("开始编辑操作失败!"  );<BR>  pWorkspaceEdit->AbortEditOperation();<BR>  return FALSE;<BR> }<BR> <BR>  <BR>  IFeaturePtr ipFeat(CLSID_Feature);<BR>  hr= pFeatureClass->CreateFeature(;ipFeat);/////////为什么老在这儿出问题?<BR>  <BR>  //ipFeat=;<BR>     if (FAILED(hr))<BR>  {<BR>       <BR>    AfxMessageBox("建立要素失败");<BR>    return hr;<BR>  }<BR>      // Create a new point and add it to the shape field<BR>      IPointPtr ipPoint(CLSID_Point);    <BR>      ipPoint->put_X(x);<BR>      ipPoint->put_Y(y);<BR>      IGeometryPtr ipGeom = ipPoint;</P>
<P>   hr = ipFeat->putref_Shape(ipGeom);<BR>    if (FAILED(hr))<BR>    return hr;<BR>      <BR>//   ipFeat->Store();<BR>      return hr;</P>
喜欢0 评分0
42261300
路人甲
路人甲
  • 注册日期2006-06-09
  • 发帖数2
  • QQ
  • 铜币112枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2007-07-10 17:36
<P>怎么没人</P>
举报 回复(0) 喜欢(0)     评分
游客

返回顶部