![]() |
Earl,how to resolve the error as "Unable to read write-only property"?
Q:
Subject: Earl,how to resolve the error as "Unable to read write-only property"? SR:1-407938223 Thanks. But, I get an error as “Unable to read write-only property” when add a call to body.EnumFaces. How to resolve the error? My code as fllows: LPUNKNOWN pFaces = NULL;
pFaces = swBody.EnumFaces();
LPDISPATCH *dFaces = NULL;
pFaces->QueryInterface(IID_IDispatch, (LPVOID*)&dFaces);Sence: SW API OLE & VC++ 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 |
所有的时间均为北京时间。 现在的时间是 11:51 PM. |