几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   SolidWorks二次开发 (http://www.dimcax.com/hust/forumdisplay.php?f=111)
-   -   【转帖】求助!各位高手们!关于sw2008的c++二次开发的问题. (http://www.dimcax.com/hust/showthread.php?t=5996)

yang686526 2009-04-14 01:54 PM

【转帖】求助!各位高手们!关于sw2008的c++二次开发的问题.
 
求助!各位高手们!关于sw2008的c++二次开发的问题.
www.dimcax.com
我用igetcustominfonames去取零件图的所有自定义属性的名称,/ q: z8 s1 q, y* u6 q' |& j. ]( x
api是status = modeldoc->igetcustominfonames( retval )
- j% g% t$ i" `# k: youtput: (bstr*) retval array of the custom property names
# q: f/ p2 |* m+ i$ v& treturn: (hresult) status s_ok if successful
- p" w t' w4 u1 s% ^) o* r而我的程序:
" z q3 g. n% k- }......' y/ y2 q" x/ w n. v- c
swapp->iopendoc(filepath,1,&retval);
}& ?+ [" t, v5 ~" y0 \+ nbstr * bstrcustominfoname;- v s7 m3 j0 x
long numparams =0;
' k6 e3 h' m1 |5 kretval->getcustominfocount(&numparams);//numparams得到的是4+ x; o4 c$ b( x; b9 j
bstrcustominfoname = new bstr[numparams];
. \3 m% g9 u) r0 q% l! {- m2 e0 r8 bretval->igetcustominfonames(bstrcustominfoname);
+ |% e# y+ n( f+ t........1 c" d7 c" c* b, y6 b. o7 e5 x
结果只有bstrcustominfoname[0] 是取到了正确的值,剩下的就报错.为什么会取不到剩下的呢???????


哪位好心人给点想法啊,急啊!!!!!!!!!!!!!!!!


所有的时间均为北京时间。 现在的时间是 10:23 AM.