Description
On Windows, if a MAPI subsystem has not been installed, calling QMessageStore::instance() results in a system message box being shown (see attachment). This happens when MAPIInitialize() is called from WinHelpers::MapiInitializer::MapiInitializer():
QtMessagingd.dll!WinHelpers::MapiInitializer::MapiInitializer() Line 1789 C++ QtMessagingd.dll!WinHelpers::initializeMapi() Line 1818 + 0x1f bytes C++ QtMessagingd.dll!MapiSession::MapiSession(QMessageStore::ErrorCode * lastError=0x004ade10) Line 3224 + 0x5e bytes C++ QtMessagingd.dll!MapiSession::createSession(QMessageStore::ErrorCode * lastError=0x004ade10) Line 3197 + 0x43 bytes C++ QtMessagingd.dll!QMessageStorePrivatePlatform::QMessageStorePrivatePlatform(QMessageStorePrivate * d=0x004adce0, QMessageStore * q=0x004add28) Line 109 + 0x72 bytes C++ QtMessagingd.dll!QMessageStorePrivate::initialize(QMessageStore * store=0x004add28) Line 144 + 0x2a bytes C++ QtMessagingd.dll!QMessageStore::instance() Line 169 C++
QtMessaging should prevent the message box from being shown, and indicate that no MAPI subsystem is available in some other way (QMessageStore::instance() could return 0 and lastError() return an appropriate error code).
It may be possible to detect the presence of a MAPI subsystem by querying the registry:
http://msdn.microsoft.com/en-us/library/cc815368.aspx
Reproduced on Windows Vista and Windows 7 without Outloook installed. Not reproducible on Windows XP with Outlook installed.