qtofttt
4th July 2010, 16:17
I have a application based on qt 4.6.2(dynamically linking).
and it uses a codec plugin named qcncodecs4.dll, which stands for Chinese.
the plugin directory is set to the application folder using QApplication::setLibraryPaths(QStringList) in "main".
I built it with VS 2008. The corresponding MSVCRT is MSVCR90.dll and MSVCP90.dll.
It runs ok on windows xp sp3, which has MSVCRT90 in the C:\WINDOWS\WINSXS.
BUT, When the app runs on windows xp sp1, which has NO msvcr90.dll and msvcp90.dll in the C:\WINDOWS\WINSXS, it cannot load the codec plugin correctly.
the folder structure is as following :
myapp/
myapp/qtcore.dll
myapp/myapp.exe
myapp/codecs
myapp/codecs/qcncodecs4.dll
myapp/Microsoft.VC90.CRT/
myapp/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
myapp/Microsoft.VC90.CRT/msvcm90.dll
myapp/Microsoft.VC90.CRT/msvcp90.dll
myapp/Microsoft.VC90.CRT/msvcr90.dll
Finally, I tried to add A COPY OF "/Microsoft.VC90.CRT" to myapp/codecs, which looks as :
myapp/
myapp/qtcore.dll
myapp/myapp.exe
myapp/codecs
myapp/codecs/Microsoft.VC90.CRT/
myapp/codecs/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
myapp/codecs/Microsoft.VC90.CRT/msvcm90.dll
myapp/codecs/Microsoft.VC90.CRT/msvcp90.dll
myapp/codecs/Microsoft.VC90.CRT/msvcr90.dll
myapp/codecs/qcncodecs4.dll
myapp/Microsoft.VC90.CRT/
myapp/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
myapp/Microsoft.VC90.CRT/msvcm90.dll
myapp/Microsoft.VC90.CRT/msvcp90.dll
myapp/Microsoft.VC90.CRT/msvcr90.dll
This time , the application runs ok on windows xp sp1.
And after I inspected the proccess using procexp.exe, I found that TWO INSTANCES of MSVCRT90 were loaded, ONE for qtcore.dll, ONE for codec/qcncodecs4.dll, while there was only ONE INSTANCE of qtcore.dll in the process.
Why does the plugin use a different instance of msvcr90 from qtcore.dll, but the same instance of qtcore.dll as the caller?
and it uses a codec plugin named qcncodecs4.dll, which stands for Chinese.
the plugin directory is set to the application folder using QApplication::setLibraryPaths(QStringList) in "main".
I built it with VS 2008. The corresponding MSVCRT is MSVCR90.dll and MSVCP90.dll.
It runs ok on windows xp sp3, which has MSVCRT90 in the C:\WINDOWS\WINSXS.
BUT, When the app runs on windows xp sp1, which has NO msvcr90.dll and msvcp90.dll in the C:\WINDOWS\WINSXS, it cannot load the codec plugin correctly.
the folder structure is as following :
myapp/
myapp/qtcore.dll
myapp/myapp.exe
myapp/codecs
myapp/codecs/qcncodecs4.dll
myapp/Microsoft.VC90.CRT/
myapp/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
myapp/Microsoft.VC90.CRT/msvcm90.dll
myapp/Microsoft.VC90.CRT/msvcp90.dll
myapp/Microsoft.VC90.CRT/msvcr90.dll
Finally, I tried to add A COPY OF "/Microsoft.VC90.CRT" to myapp/codecs, which looks as :
myapp/
myapp/qtcore.dll
myapp/myapp.exe
myapp/codecs
myapp/codecs/Microsoft.VC90.CRT/
myapp/codecs/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
myapp/codecs/Microsoft.VC90.CRT/msvcm90.dll
myapp/codecs/Microsoft.VC90.CRT/msvcp90.dll
myapp/codecs/Microsoft.VC90.CRT/msvcr90.dll
myapp/codecs/qcncodecs4.dll
myapp/Microsoft.VC90.CRT/
myapp/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
myapp/Microsoft.VC90.CRT/msvcm90.dll
myapp/Microsoft.VC90.CRT/msvcp90.dll
myapp/Microsoft.VC90.CRT/msvcr90.dll
This time , the application runs ok on windows xp sp1.
And after I inspected the proccess using procexp.exe, I found that TWO INSTANCES of MSVCRT90 were loaded, ONE for qtcore.dll, ONE for codec/qcncodecs4.dll, while there was only ONE INSTANCE of qtcore.dll in the process.
Why does the plugin use a different instance of msvcr90 from qtcore.dll, but the same instance of qtcore.dll as the caller?