几何尺寸与公差论坛

 找回密码
 注册
查看: 649|回复: 0

【转帖】saveas jpgstep on ondestroy

[复制链接]
发表于 2009-4-12 22:18:31 | 显示全部楼层 |阅读模式
saveas jpg/step/ on ondestroy
hi
can enyone help me.
i have written an api. i want to save my part/assembly/drawing in different formats just before the user is closing the document. i use the destroynotify event and the modeldoc2.saveas4. it is ok, if it is a .igs file, but if it is .jpg file then the file is generated and the resultkode is ok, but the file is empty.
if i make the same save in the savetostoragenotify event, then it is ok.
best regards
hanne vedel
cadsys
you shouldn't be calling any intensive or important functions in the ondestroy event handler as it is unsafe and your image will be blank because some of the handles and pointers to the document is probably destroyed at that point.
change your saving function to run on another event handler before it is destroyed.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-23 15:11 , Processed in 0.034202 second(s), 20 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表