As per the documentation,
SetActiveTab[
^] function failed in your code. Find out why it is failed by debugging further to SetActiveTab function. My guess is, the window (The outlook control) yet in creation process and the m_hWnd handle is not yet a valid one.
You can assert this by calling the SetActiveTab function later from a button click or timer, if it is working then, you may consider a design change.