Hello all.
I use both these libraries in my project. Below I describe a conflict between them.
See ole initialization code used in Qt:
file C:\Qt\4.8.3\src\gui\kernel\qapplication_win.cpp
#ifndef Q_WS_WINCE
// Initialize OLE/COM
// S_OK means success and S_FALSE means that it has already
// been initialized
HRESULT r;
r = OleInitialize(0);
if (r != S_OK && r != S_FALSE) {
qWarning("Qt: Could not initialize OLE (error %x)", (unsigned int)r);
}
#endif
#ifndef Q_WS_WINCE
// Initialize OLE/COM
// S_OK means success and S_FALSE means that it has already
// been initialized
HRESULT r;
r = OleInitialize(0);
if (r != S_OK && r != S_FALSE) {
qWarning("Qt: Could not initialize OLE (error %x)", (unsigned int)r);
}
#endif
To copy to clipboard, switch view to plain text mode
WinAPI function OleInitialize returns error code defined as RPC_E_CHANGED_MODE (Cannot change thread mode after it is set), because OLE has already been initialized by ptlib by
::CoInitializeEx(NULL, COINIT_MULTITHREADED);
invocation.
qWarning shows this message: "Qt: Could not initialize OLE (error 80010106)".
But after application is closed, it crashes with access violation and following call stack:
Here we see ole32.dll...
Apparently, root cause is differed OLE initialization parameters and maybe combined OLE usage.
Can anyone help me to reveal a workaround?
Thank you.
Bookmarks