马上注册登录,享用更多网站功能!
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
这段代码就是想对打开的模型所有特征进行访问,可是编译时告诉说>正在编译...
1>Dlg.cpp
1>e:\vc++2005example\myprogram\myprogram\dlg.cpp(88) : error C2440: 'type cast' : cannot convert from 'overloaded-function' to 'ProFeatureVisitAction'
1> None of the functions with this name in scope match the target type
1>生成日志保存在“file://e:\vc++2005example\myprogram\myprogram\Debug\BuildLog.htm”
这是什么原因呢?好像是说访问函数的事啊!有懂的吗?谢谢啊!!
////下面是在树控件中显示模型的特征树 m_tree.DeleteAllItems(); status=ProMdlNameGet(model,name); ProWstringToString(strName,name); HTREEITEM hItem=m_tree.InsertItem(TVIF_TEXT|TVIF_PARAM,(CString(strName)),0,0,0,0,-1,NULL,NULL); CArray*p_FeatureList=NULL; status=ProSolidFeatVisit(cur_solid,(ProFeatureVisitAction)PartFeatVisFn,NULL,(ProAppData)p_FeatureList); numoffeat=(int)p_FeatureList->GetCount(); if(numoffeat==0)return TRUE; for(int i=0;iGetAt(i),name); if(status==PRO_TK_E_NOT_FOUND) { ProFeatureTypenameGet(&p_FeatureList->GetAt(i),name); ProWstringToString(strName,name); sprintf(strName,"%s ID numeber %d",strName,p_FeatureList->GetAt(i).id); } else if (status==PRO_TK_BAD_INPUTS) { sprintf(strName,"invalid!"); } else { ProWstringToString(strName,name); } m_tree.InsertItem(TVIF_TEXT|TVIF_PARAM,CString(strName),0,0,0,0,i,hItem,NULL); } m_tree.Expand(hItem,TVE_EXPAND); ////显示完毕 return TRUE; } /////访问动作函数 ProError PartFeatVisFn(ProFeature* p_feature,ProError status,CArray* app_data) { ProBoolean isVisible; int* r_failed_feat_ids; int num=0; ProBoolean p_is_incomplete; ProFeatStatus p_status; status=ProArrayAlloc(0,sizeof(int),1,(ProArray*)&r_failed_feat_ids); status=ProSolidFailedFeatsList((ProSolid)(p_feature->owner),&r_failed_feat_ids); status=ProArraySizeGet((ProArray)r_failed_feat_ids,&num); for(int i=0;iid==r_failed_feat_ids[i]) { ProArrayFree((ProArray*)&r_failed_feat_ids); return PRO_TK_NO_ERROR; } } //////// status=ProFeatureIsIncomplete(p_feature,&p_is_incomplete); if(p_is_incomplete!=PRO_B_FALSE)return PRO_TK_NO_ERROR; status=ProFeatureStatusGet(p_feature,&p_status); if(p_status==PRO_FEAT_SUPPRESSED)return PRO_TK_NO_ERROR; if(p_status!=PRO_FEAT_ACTIVE) return PRO_TK_NO_ERROR; status=ProFeatureVisibilityGet(p_feature,&isVisible); if(isVisible==PRO_B_TRUE) { app_data->Add(*p_feature); } return PRO_TK_NO_ERROR; } |