几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   -   【转帖】setupactivelayoutviews Gp In 1.13 Not In 1.12 (http://www.dimcax.com/hust/showthread.php?t=18565)

yang686526 2009-05-07 03:48 PM

【转帖】setupactivelayoutviews Gp In 1.13 Not In 1.12
 
setupactivelayoutviews gp in 1.13 not in 1.12
setupactivelayoutviews gp in 1.13 not in 1.12
a call to...
oddbgsmanager::setupactivelayoutviews(this, m_rutldxfcontext);
...in a exsimpleview style implementation failes on "0xc0000005: access violation".
visual studio 6.0, dd version 1.13, dd and ms debug dlls. what i have checked:
o) works fine with dd version 1.12
o) correct dlls seems to be loaded.
o) i have added pmyview->init(this, pinfo, benablelayervisibilityperview); to createview.
o) as far as i can judge, the parameters to setupactivelayoutviews exist and are initiated.
o) fails on any dwg at the same spot.
i assume the fault is in my code, but i'm pretty much in the dark here. any clue on where to look would be appreciated. the null pointer reference could indicate that something is not properly initiated from my side. it might be something that was not significant i 1.12 or that the call (sequence) is different in 1.13.
i do not have the oda source, but here is the stack trace and assembly listing if is of any help:
==> dd_gs! 010693af()
dd_gs! 0104703a()
dd_db! 01119506()
dd_db! 011182ea()
dd_db! 015f15a4()
dd_db! 015f0ead()
01069340 push ebp
01069341 mov ebp,esp
01069343 push 0ffh
01069345 push 106d179h
0106934a mov eax,fs:[00000000]
01069350 push eax
01069351 mov dword ptr fs:[0],esp
01069358 sub esp,54h
0106935b push ebx
0106935c push esi
0106935d push edi
0106935e lea edi,[ebp-60h]
01069361 mov ecx,15h
01069366 mov eax,0cccccccch
0106936b rep stos dword ptr [edi]
0106936d mov dword ptr [ebp-10h],0
01069374 call 010319dd
01069379 cmp dword ptr [ebp+0ch],eax
0106937c jne 0106939a
0106937e mov eax,dword ptr [ebp+8]
01069381 mov dword ptr [ebp-10h],eax
01069384 mov ecx,dword ptr [ebp-10h]
01069387 mov edx,dword ptr [ecx]
01069389 mov esi,esp
0106938b mov ecx,dword ptr [ebp-10h]
0106938e call dword ptr [edx+10h]
01069391 cmp esi,esp
01069393 call 0106aa8c
01069398 jmp 01069407
0106939a mov esi,esp
0106939c mov eax,dword ptr [ebp+0ch]
0106939f push eax
010693a0 lea ecx,[ebp-14h]
010693a3 push ecx
010693a4 call 010319dd
010693a9 mov dword ptr [ebp-18h],eax
010693ac mov edx,dword ptr [ebp-18h]
==> 010693af mov eax,dword ptr [edx]
010693b1 mov ecx,dword ptr [ebp-18h]
010693b4 call dword ptr [eax+30h]
010693b7 cmp esi,esp
010693b9 call 0106aa8c
010693be mov dword ptr [ebp-1ch],eax
010693c1 mov ecx,dword ptr [ebp-1ch]
010693c4 mov dword ptr [ebp-20h],ecx
010693c7 mov dword ptr [ebp-4],0
010693ce mov ecx,dword ptr [ebp-20h]
010693d1 call 0103110e
010693d6 mov dword ptr [ebp-10h],eax
010693d9 mov dword ptr [ebp-4],0ffffffffh
010693e0 lea ecx,[ebp-14h]
010693e3 call 010324d2
010693e8 cmp dword ptr [ebp-10h],0
010693ec jne 01069407
010693ee mov esi,esp
010693f0 mov edx,dword ptr [ebp+0ch]
010693f3 push edx
010693f4 mov ecx,dword ptr [ebp+8]
010693f7 call dword ptr ds:[109cc90h]
010693fd cmp esi,esp
010693ff call 0106aa8c
01069404 mov dword ptr [ebp-10h],eax
01069407 mov eax,dword ptr [ebp-10h]
0106940a mov ecx,dword ptr [ebp-0ch]
0106940d mov dword ptr fs:[0],ecx
01069414 pop edi
01069415 pop esi
01069416 pop ebx
01069417 add esp,60h
0106941a cmp ebp,esp
0106941c call 0106aa8c
01069421 mov esp,ebp
01069423 pop ebp
01069424 ret
eax = 00000000 ebx = 00000001 ecx = 00000000
edx = 00000000 esi = 0012f268 edi = 0012f2c8
eip = 010693af esp = 0012f260 ebp = 0012f2d4
efl = 00000206
cs = 001b ds = 0023 es = 0023 ss = 0023
fs = 003b gs = 0000 ov=0 up=0 ei=1 pl=0 zr=0
ac=0 pe=1 cy=0
mxcsr = 00001f80
ctrl = 027f stat = 4020 tags = ffff
eip = 00dc36fe
cs = 001b ds = 0023 edo = 0012f230
-rune jorgensen
www.dds.no

i got the tip to try odgsinitialize. the code below works. if i remove the odgs calls it failes.
odinitialize(&utldxfsvcs);
odgsinitialize();
...my program...
odgsuninitialize();
oduninitialize();
the doc says: "odgsinitialize must be called before using any gs implementation classes. odgsbasemodule::initapp() calls this function so there is no need to call it explicitly in case of using gs classes within rx module derrived from odgsbasemodule."
difficult to guess in advance that this was neccessary for our code in 1.13, but we now have a working solution!
-rune jorgensen
www.dds.no


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