Comment on COM+ RevisitedparentComments−colejohnson664y#2 is horrid, but could be solved by inverted if conditions and a single “cleanup:” label with goto: if (!SUCCEEDED(hr)) goto cleanup;−benibela4yOr: if (SUCCEEDED(pfd->Advise(pfde, &dwCookie)) && SUCCEEDED(pfd->GetOptions(&dwFlags)) && SUCCEEDED(pfd->SetOptions(dwFlags | FOS_FORCEFILESYSTEM)) && SUCCEEDED(pfd->SetFileTypes(ARRAYSIZE(c_rgSaveTypes), c_rgSaveTypes)) && ... )−userbinator4yThe point is that all those function calls aren't necessary, nor could the majority of them ever fail. Assigning to a field in a structure doesn't fail nor result in a function call.
Comments
#2 is horrid, but could be solved by inverted if conditions and a single “cleanup:” label with goto:
Or:
The point is that all those function calls aren't necessary, nor could the majority of them ever fail. Assigning to a field in a structure doesn't fail nor result in a function call.