What's wrong with this code, part 10
Ok, time for another "what's wrong with this code". This one's trivial from a code standpoint, but it's tricky...
// ----------------------------------------------------------------------// Function:// CThing1::OnSomethingHappening()//// Description:// Called when something happens//// Return:// S_OK if successful//// ----------------------------------------------------------------------HRESULT CThing1::OnSomethingHappening(){ HRESULT hr; : : <Do Some Stuff> : // Perform some operation... hr = PerformAnOperation(); if (FAILED(hr)) hr = ERROR_NOT_SUPPORTED; IF_FAILED_JUMP(hr, Error);Exit: return hr;Error: goto Exit;}
Not much code, no? So what's wrong with it?
As usual, answers and kudos tomorrow.