Original Post
I have found a bug in the following code:
void
InputDevice::GetPropertyDWORD (REFGUID PropType, DWORD & Data)
{
DIPROPDWORD DIDWord;
DIPROPHEADER DIProp;
DIProp.dwHeaderSize = sizeof(DIPROPHEADER);
DIProp.dwSize = sizeof (DIPROPDWORD);
DIProp.dwHow = DIPH_DEVICE;
DIProp.dwObj = 0;
DIDWord.diph = DIProp;
DIDWord.dwData = 0;
// TODO: Watch out not to do &DIProp but &DIDWord.diph
this->GetProperty (PropType, &DIProp); //<= &DIProp instead of &DIDWprd.diph cause a bug
Data = DIDWord.dwData;
} // <= break place from exception
I have found this bug, but what bugged me is that an exception was throwing and my catch(...) didnt catch it. I guess that this is because the exception was throwen from within a destructor. In that case, how can such exception be caught and handled? Thanks in advance.