查看单个帖子
旧 2007-05-20, 09:48 AM   #2
yogy
高级会员
 
注册日期: 06-11
帖子: 1527
精华: 15
现金: 6353 标准币
资产: 6353 标准币
yogy 向着好的方向发展
默认 回复: Earl,how to resolve the error as "Unable to read write-only property"?

R:
Hello,

Ah. It looks like you are using the older swdisp.h and swdisp.cpp interfaces for SW. In that case, you might look at using:



#import “sldworks.tlb” raw_interfaces_only



LPDISPATCH pDisp = swBody;

SldWorks::IBody2 *comBody;

pDisp->QueryInterface(__uuidof(SldWorks::IBody2), (LPVOID*)&comBody);



SldWorks::IEnumFaces2 *comEnumFaces;

comBody->get_IEnumFaces(&comEnumFaces);

// … do your work…



This will allow you to get to the COM version of the object and work with it directly. Be sure to call the object’s Release() method when done with each object.





Regards,

-Earl
yogy离线中   回复时引用此帖