Original Post
seems when i assign a pointer, im getting the last variable in one class overwritten. so i have the following code (note, nop's just for debugging purposes):
void OGLDevice::SetActiveWindow(Win32Window* wnd)
{
__asm nop
activeWindow = wnd;
__asm nop
ResetDevice(activeWindow->GetWidth(), activeWindow->GetHeight());
}
equates to this in assembly with vc2005 beta 2:
__asm nop
00408073 nop
activeWindow = wnd;
00408074 mov eax,dword ptr [this]
00408077 mov ecx,dword ptr [wnd]
0040807A mov dword ptr [eax],ecx
__asm nop
0040807C nop
now: this = 0x0012fcd5 wnd = 0x0012fcbc &(wnd->height) = 0x0012fcd4 obviously wnd->height is the last variable in my wnd class with the this class comming right after it. Seems when i do my pointer assignment, it writes data to both this->activeWindow (which is the first variable in the this class), and wnd->height. Both end up with an incorrect value how ever. If i take some variables out of my wnd class this does not occur. I assume this is due to memory alignment or padding?