- Every CoInitialize that succeeds needs a CoUninitialize otherwise the reference counting gets off and all heck breaks loose
- Every CoInitialize that fails should NOT call CoUninitialize otherwise the reference counting gets off and all heck breaks loose
- Use an HRESULT variable and capture the result of the CoInitialize. Use the SUCCEEDED macro to determine, drumroll please, if the CoInitialize succeeded.
- There are a couple other, more remote, cases, read about them in the link above.
10.9.08
CoInitialize/CoUninitialize: Rules to live by
After reading Ben Kuhn's post on the subject, I realized how poorly this is being managed in the code of my current project. The rules are basically:
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment