c++ - Inconsistent member offset computation in MFC class -
in our vs2013 mfc project, cwinapp application class has cwordarray member.
looking @ dissassembly can tell offset of member 21eh.
this call setsize assembly code called within cwinapp:
m_arraydefind.setsize(64, 1); 00f36d0f push 1 00f36d11 push 40h 00f36d13 mov ecx,dword ptr [this] 00f36d16 add ecx,21eh <<<<<< note offset 00f36d1c call cwordarray::setsize (0fc25e0h) however, in cview class, retrieve cwinapp pointer , reference same member. when @ dissassembly code in cview class, compiler has set offset @ 230h.
cmyapp *papp = (cmyapp *)afxgetapp(); int size = papp->m_arraydefind.getsize(); 00f2da42 mov ecx,dword ptr [ebp-20h] 00f2da45 add ecx,230h <<<<<< note offset 00f2da4b call cwordarray::getsize (0fc225ch) 00f2da50 mov dword ptr [ebp-24h],eax we have done obvious – clean, rebuild all. have ensured both compilation units using same application header file.
the above ported vs6 application handles correctly.
we're @ loss explain above. can help?
Comments
Post a Comment