ecitluo 发表于 2007-9-27 15:26:00

IAcadSelectionSet的Select函数怎么设置?

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