1. 程式人生 > >Unicode的設定不一致,導致CString的使用有記憶體洩露

Unicode的設定不一致,導致CString的使用有記憶體洩露

一個unicode的對話方塊程式用一個不是unicode用一個使用了CString的activex控制元件,就有如下錯誤

Detected memory leaks!

Dumping objects ->
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\plex.cpp(29) : {502} normal block at 0x0039BED8, 124 bytes long.
 Data: <              9 > 00 00 00 00 00 00 00 00 00 00 00 00 98 BE 39 00
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\occmgr.cpp(788) : {501} normal block at 0x0039BE98, 4 bytes long.
 Data: <   x> CC AB A0 78
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(141) : {453} normal block at 0x0039B438, 36 bytes long.
 Data: <   x            > 0C F0 E4 78 09 00 00 00 09 00 00 00 01 00 00 00
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(141) : {452} normal block at 0x0039B3E0, 22 bytes long.
 Data: <   x            > 0C F0 E4 78 02 00 00 00 02 00 00 00 01 00 00 00
{405} client block at 0x003990F0, subtype c0, 64 bytes long.
a CDynLinkLibrary object at $003990F0, 64 bytes long
a CDynLinkLibrary object at $003990F0, 64 bytes long
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(141) : {400} normal block at 0x00398E98, 28 bytes long.
 Data: <   x            > 0C F0 E4 78 05 00 00 00 05 00 00 00 01 00 00 00
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(141) : {399} normal block at 0x00398E40, 28 bytes long.
 Data: <   x            > 0C F0 E4 78 05 00 00 00 05 00 00 00 01 00 00 00
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(141) : {398} normal block at 0x00398DD0, 52 bytes long.