最近,小弟碰上一个问题,希望各位帮帮忙,我的代码是这样的: COleVariant covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR); IAcadApplication app; oDoc1=app.GetActiveDocument(); IAcadDatabase oDb=oDoc1.GetDatabase(); ModSp=oDb.GetModelSpace(); COleSafeArray type; IAcadSelectionSets sets=oDoc1.GetSelectionSets(); IAcadSelectionSet set; try { set=sets.Add(L"test"); COleSafeArray value,data; short typei[]={8}; TCHAR v[]=_T("0"); data.CreateOneDim(VT_UI1,sizeof(v)/sizeof(TCHAR),v); type.CreateOneDim(VT_I2,1,typei); set.Select (5,covOptional,covOptional,type, data); } catch (CException* e) { TCHAR szError[256]; e->GetErrorMessage(szError,255); AfxMessageBox(szError); } 在运行到 set.Select (5,covOptional,covOptional,type, data) 出错:参数FilterData位于Select中无效, 而用 set.Select(5,covOptional,covOptional,covOptional,covOptional) 却可以运行, 这个Select函数要怎么设置参数啊, Select函数的原型是: void IAcadSelectionSet::Select(long Mode, const VARIANT& Point1, const VARIANT& Point2, const VARIANT& FilterType, const VARIANT& FilterData)
|