The information in this article applies to:
SUMMARY
If CoInitializeEx is called with the COINIT_MULTITHREADED flag before MAPIInitialize is called, you will get error 0x80010106 (E_INVALID_FLAGS or RPC_E_CHANGED_MODE). To prevent this error, set MAPI_NO_COINIT (value of 0x8) in the ulFlags member of the MAPIINIT_0 structure passed in MAPIInitialize. MORE INFORMATION
MAPI, by default, will try to initialize COM with a call to CoInitialize. This initializes COM with a single threaded apartment model. Since COM has already been initialized with a multithreaded model and the threading model cannot be changed, MAPIInitialize will fail and return RPC_E_CHANGED_MODE. Steps to Reproduce BehaviorThe following code will show the error code and how to use MAPI_NO_COINIT to avoid it:
Uncomment the line with MAPI_NO_COINIT will clear the error.
REFERENCESFor additional information about a related fix, please click the article number below in the Microsoft Knowledge Base: Q179116 FIX: MAPIInitialize() Fails with MAPI_E_INVALID_FLAGS Additional query words:
Keywords : kbXchge550 kbMAPI kbMsg kbVC kbGrpMsg kbDSupport |
Last Reviewed: November 13, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |