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