几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】oddbtext textstring90 return issue (http://www.dimcax.com/hust/showthread.php?t=17620)

yang686526 2009-05-06 08:16 PM

【转帖】oddbtext textstring90 return issue
 
oddbtext textstring() return issue
oddbtext textstring() return issue
i've worked around the issue but oddbtext.textstring() doesn't seem to be null terminating some strings in some new autocad 2007 drawings. i've attached a drawing that was causing some issues.
attached files
hello ryan,
new autocad 2007 drawings have unicode strings. oddbtext.textstring() returns odstring. that problem do you have? could you explain your problem more detail?
best regards,
sergey z.
some of the strings from textstring() had tons of whitespace on the end of them giving a buffer overflow when using strcpy. this was fixed using strncpy but the whitespace is still there.
quote:
originally posted by ryan
some of the strings from textstring() had tons of whitespace on the end of them giving a buffer overflow when using strcpy. this was fixed using strncpy but the whitespace is still there.
try to use odstring::trimright() for removing whitespace on the end of string and set back this string to text.
note i have found only one text with about 14500 whitespace (handle 99ad9).
best regards,
sergey z.


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