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


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » AutoCAD二次开发 » DirectDWG
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


回复
 
主题工具 搜索本主题 显示模式
旧 2009-05-04, 02:50 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】1.14.02 bug

1.14.02 bug?
1.14.02 bug?
i am creating two devices just like odamfcapp. one is the primary device, the other is an overlay device. the primary device is created with:
windowhdc, clearscreen (true), doublebufferenabled(true), enablesoftwarehlr(true), discardbackfaces(true). the overlay with: windowhdc, clearscreen (false), doublebufferenabled(false). the primary device will draw appropriately. the overlay doesn't. if i comment out the primary draw then i can get the overlay to draw. has oda changed how it works with double buffering? our code works nicely with 1.14.01, but i can't get both device to draw at the same time in 1.14.02 . obviously, something has changed in the hdc management code inside oda. i've looked carefully at odamfc for clues but there really is no difference in the way we create/use the devices. however, we are using our own threading model so its not easy to try exactly what odamfcapp does. i've been through the changes to the header signatures for the new code and there aren't any smoking guns there either.
george,
sorry about the double post. i am sure its 1.14.2 and wingdi.gs related. are you keeping the hdc around for each device? we are calling invalidate and update for each device (the primary and highlight devices). i've noticed that when i only have the highlight device turned on (clearscreen (false), doublebufferenabled(false)) i get a resource leak of some sort. my createcompatibledc eventually fails and all hell breaks loose. i have tried a ton of variations and i can't get any of them to work. please elaborate on the double buffering scheme your utilizing.
i just discovered the source code -- and i have found the bug! it is in the exgsscreendevice code. what was happening was we were passing both the hdc and hwnd.
code:

void createcontext()
{
if(m_hwnd && !m_hdc)
m_hdc = ::getdc(m_hwnd);
if(!m_hdc)
throw oderror(enotinitializedyet);
m_ncolordepth = getdevicecolordepth();
t::createcontext();
}
void deletecontext()
{
t::deletecontext();
if (m_hdc && m_hwnd)
{
::releasedc(m_hwnd, m_hdc);
m_hdc = null;
}
}
note that the ::getdc is not called if the m_hdc is passed in...but ::releasedc is called regardless. hence the nasty surprise i experienced. if you want to reproduce in odamfc app just pass the hwnd and hdc into the device's dictionary props.
i forgot all the devices were in the source code; it would have saved me a couple of days of insanity.
thanks,
tyler
george,
thats how i fixed it too. i also had to fix one other bug associated with the compatibledc living the span of the device; onsize must update the size of the compatibledc's bitmap. to reproduce: start with a smaller app window and resize to a larger one. oda neat draws onto the originally size device context because the bitmap is not resized.
thanks,
tyler
still can not resize window
tyler,
i did apply both fixes to the code. still can not resize singledoc sample: window keeps all background in new area.
could you, please, give more directions how to fix it?
life would be so much easier if we could just look at the source codefff">fff">
i'm having the same problem with singledoc
is there a solution for this problem? i verified that my code has all these fixes, yet singledoc still does not repaint properly when the window size goes beyond a certain point. when i size smaller, it generally works.
i also applied the fixes from the dwgdirect.zip in a later post.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】这是intersectwith的bug还是什么原因,附上测试的图和代码,大家看看什么原因 yang686526 ObjectARX(C++) 0 2009-04-18 10:47 PM
【转帖】[arx]objectarx6是不是有bug啊,大家分析一下! yang686526 ObjectARX(C++) 0 2009-04-16 11:44 AM
【转帖】arx的官方例子也有bug?cedit及其派生类在删除文本框中的字符时显示有问题 yang686526 ObjectARX(C++) 0 2009-04-14 03:47 PM
【转帖】swdocumentmgr bug yang686526 SolidWorks二次开发 0 2009-04-13 02:53 PM


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


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多