dememax ([personal profile] dememax) wrote2010-04-18 12:23 am

WTL-приложение: зависимости на примере MDIDocVw

Случилось так, что в начале 2000-x я писал на плюсах с помощью WTL приложение для прайс-листа одной компьютерной компании с большим количеством таблиц, диалогов, ...
Чтобы закрыть тему зависимостей времени выполнения (runtime) приложений, построенных на основе WTL, я решил проверить имеющимися средствами, как всё обстоит.

На моём ноуте с Microsoft Windows XP стоит Microsoft Visual Studio 2010 Professional Version 10.0.21006.1 B2Rel (т.е. бета, которую я скачал вместо Express-версии чтобы проверить запрещение ADL с помощью круглых скобок).
Скачал с сайта WTL последнюю версию - WTL80_7161_Final.zip размером 877.8 KB от 2007-06-12.
Собрал пример MDIDocVw.
В релизе получился файлик MDI.exe размером 168448 байт, который зависит от следующих динамических библиотек (использована статья Windows API):
comctl32.dll
Common Control Library, standard Windows controls, such as File Open, Save, and Save As dialogs, progress bars, and list views
kernel32.dll
Base Services, low-level operating system functions for memory management and resource handling
user32.dll
User Interface, windows management functions for message handling, timers, menus, and communications
gdi32.dll
Graphics Device Interface (GDI) functions for device output, such as those for drawing and font management.
comdlg32.dll
Common Dialog Box Library, standard dialog boxes for opening and saving files, choosing color and font, etc
advapi32.dll
Advanced Services, access to functionality that is an addition on the kernel, things like the Windows registry, shutdown/restart the system (or abort), start/stop/create a Windows service, manage user accounts
ole32.dll
COM
oleaut32.dll
OLE Automation
Вот, как показывает зависимости полученного WTL-приложения собранного в релизе 2010-ой студией Dependency Walker:
Просмотр runtime-зависимостей с помощью Dependency Walker приложения MDIDocVw из примеров WTL.(показана часть окна Dependency Walker; нажмите на картинке для просмотра полного окна)


Не удивительно, что на голой WINE это приложение запустилось без проблем, вот лог того, что сыпалось в консоль (с дополнительной информацией в начале):
max@localhost ~ $ uname -a
Linux localhost 2.6.29-gentoo-r5 #5 SMP Mon Jun 1 22:33:31 MSD 2009 x86_64 AMD Turion(tm) X2 Dual-Core Mobile RM-70 AuthenticAMD GNU/Linux
max@localhost ~ $ wine --version
wine-1.1.35
max@localhost ~ $ wine tmp/WTL/MDI.exe 
wine: created the configuration directory '/home/max/.wine'
fixme:mixer:ALSA_MixerInit No master control found on HDA ATI HDMI, disabling mixer
fixme:system:SetProcessDPIAware stub!
fixme:dwmapi:DwmIsCompositionEnabled 0x33cf34
fixme:file:MoveFileWithProgressW MOVEFILE_WRITE_THROUGH unimplemented
fixme:advapi:SetNamedSecurityInfoW L"C:\\windows\\system32\\gecko\\1.0.0\\wine_gecko\\components\\xpti.dat" 1 536870916 (nil) (nil) 0x216fb4 (nil)
fixme:iphlpapi:NotifyAddrChange (Handle 0xa82e8d8, overlapped 0xa82e8e0): stub
fixme:iphlpapi:GetAdaptersAddresses no support for IPv6 addresses
fixme:file:MoveFileWithProgressW MOVEFILE_WRITE_THROUGH unimplemented
fixme:advapi:SetNamedSecurityInfoW L"C:\\windows\\system32\\gecko\\1.0.0\\wine_gecko\\components\\compreg.dat" 1 536870916 (nil) (nil) 0x1ee5c34 (nil)
fixme:shell:DllCanUnloadNow stub
wine: configuration in '/home/max/.wine' has been updated.
fixme:heap:HeapSetInformation (nil) 1 (nil) 0
err:toolbar:TOOLBAR_GetImageListForDrawing bitmap for ID 0, index 0 is not valid, number of bitmaps in imagelist: 0
err:toolbar:TOOLBAR_GetImageListForDrawing bitmap for ID 0, index 0 is not valid, number of bitmaps in imagelist: 0
err:toolbar:TOOLBAR_GetImageListForDrawing bitmap for ID 0, index 0 is not valid, number of bitmaps in imagelist: 0
err:toolbar:TOOLBAR_GetImageListForDrawing bitmap for ID 0, index 0 is not valid, number of bitmaps in imagelist: 0
err:toolbar:TOOLBAR_GetImageListForDrawing bitmap for ID 0, index 0 is not valid, number of bitmaps in imagelist: 0
err:toolbar:TOOLBAR_GetImageListForDrawing bitmap for ID 0, index 0 is not valid, number of bitmaps in imagelist: 0
err:toolbar:TOOLBAR_GetImageListForDrawing bitmap for ID 0, index 0 is not valid, number of bitmaps in imagelist: 0
err:toolbar:TOOLBAR_GetImageListForDrawing bitmap for ID 0, index 0 is not valid, number of bitmaps in imagelist: 0
err:toolbar:TOOLBAR_GetImageListForDrawing bitmap for ID 0, index 0 is not valid, number of bitmaps in imagelist: 0
err:toolbar:TOOLBAR_GetImageListForDrawing bitmap for ID 0, index 0 is not valid, number of bitmaps in imagelist: 0
err:toolbar:TOOLBAR_GetImageListForDrawing bitmap for ID 0, index 0 is not valid, number of bitmaps in imagelist: 0
err:toolbar:TOOLBAR_GetImageListForDrawing bitmap for ID 0, index 0 is not valid, number of bitmaps in imagelist: 0
err:toolbar:TOOLBAR_GetImageListForDrawing bitmap for ID 0, index 0 is not valid, number of bitmaps in imagelist: 0
err:toolbar:TOOLBAR_GetImageListForDrawing bitmap for ID 0, index 0 is not valid, number of bitmaps in imagelist: 0
err:toolbar:TOOLBAR_GetImageListForDrawing bitmap for ID 0, index 0 is not valid, number of bitmaps in imagelist: 0
err:toolbar:TOOLBAR_GetImageListForDrawing bitmap for ID 0, index 0 is not valid, number of bitmaps in imagelist: 0
err:toolbar:TOOLBAR_GetImageListForDrawing bitmap for ID 0, index 0 is not valid, number of bitmaps in imagelist: 0
err:toolbar:TOOLBAR_GetImageListForDrawing bitmap for ID 0, index 0 is not valid, number of bitmaps in imagelist: 0
err:toolbar:TOOLBAR_GetImageListForDrawing bitmap for ID 0, index 0 is not valid, number of bitmaps in imagelist: 0
err:toolbar:TOOLBAR_GetImageListForDrawing bitmap for ID 0, index 0 is not valid, number of bitmaps in imagelist: 0
err:toolbar:TOOLBAR_GetImageListForDrawing bitmap for ID 0, index 0 is not valid, number of bitmaps in imagelist: 0
max@localhost ~ $ 

Приложение MDI.exe под Wine'ом

Update: Кстати, насколько я понимаю, в данном случае нет зависимости от плюсового runtime'а? :-)

[identity profile] blueher.livejournal.com 2010-04-18 05:56 am (UTC)(link)
100% что приложение собрано с CRT статически. Потому и нет зависимости от msvcrXXX.dll

Re: 100% что приложение собрано с CRT статически. Потому и н

(Anonymous) 2010-04-19 06:43 am (UTC)(link)
Смотреть надо на RuntimeLibrary="0"
Далее вот сюда http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.vcprojectengine.runtimelibraryoption.aspx (циферок для констант там нет, но начинаются они с нуля). Как мы видим, выбрана rtMultiThreaded, т.е. релизная статическая версия CRT
Для дебага же RuntimeLibrary="3" выбрана rtMultiThreadedDebugDLL - дебажная динамическая версия CRT.