<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet href="http://rss.egloos.com/style/blog.xsl" type="text/xsl" media="screen"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
	<title>개 풀 뜯어먹는 소리</title>
	<link>http://pallas.egloos.com</link>
	<description>잘 될꺼야..</description>
	<language>ko</language>
	<pubDate>Thu, 27 Mar 2008 06:03:23 GMT</pubDate>
	<generator>Egloos</generator>
	<image>
		<title>개 풀 뜯어먹는 소리</title>
		<url>http://pds2.egloos.com/logo/1/200603/18/05/a0001305.jpg</url>
		<link>http://pallas.egloos.com</link>
		<width>80</width>
		<height>80</height>
		<description>잘 될꺼야..</description>
	</image>
  	<item>
		<title><![CDATA[ 아이 약 먹이는 방법 ]]> </title>
		<link>http://pallas.egloos.com/1732566</link>
		<guid>http://pallas.egloos.com/1732566</guid>
		<description>
			<![CDATA[ 
  준우가 약을 너무 못 먹어 걱정이다.<br>감기가 심해 약을 잘 먹어야 하는데.. 거부 정도를 넘어 약만 보면 경기를 일으킬 정도이다.<br><br>지식검색을 통해 도움을 얻어보려 했는데, 아직 명쾌한 방법은 보이질 않는다..<br><br>다음은 이것 저것 찾아본 내용들..<br><br>우선, 아이가 지나치게 거부하는 경우에는 부모가 먼저 맛을 보는 것이 중요하다.<br>간혹, 어른들이 먹기에도 지나치게 쓴 경우가 있기 때문이다.<br>또한, 안 먹는다고 야단치기 보다는 잘 먹었을 때 칭찬해주는 것이 좋으며 3세이상의 아이에게는 약을 먹어야 하는 이유를 알아듣게 설명하여 주는 것이 좋다.<br><br>가루약의 경우, 소량의 설탕시럽에 개어 아이의 입안에 발라 주고 즉시 물을 먹이는 방법이 있다 (몇살까지 해당되는 방법일지..)<br>우유에 타서 먹이지 말것. 우유맛을 변하게 하여 우유를 싫어하게 만들 수도 있기 때문 (준우에게도 쥬스로 시도했던 방법. 다음부터 쥬스를 안 먹으려 하는 부작용외에 1/3쯤 먹고 남겨버려 난감한 상황도 발생..)<br>탄산음료와 섞어 마시게 하는 것도 금물.. 위장 장애의 위험이 있음.<br><br><div style="text-align:center"><img class="image_mid" border="0" onmouseover="this.style.cursor='pointer'" alt="" src="http://pds7.egloos.com/pds/200803/27/05/a0001305_47eb384822513.jpg" width="500" height="374.808575804" onclick="Control.Modal.openDialog(this, event, 'http://pds7.egloos.com/pds/200803/27/05/a0001305_47eb384822513.jpg');" /></div><br/><br/>tag : <a href="/tag/약" rel="tag">약</a>			 ]]> 
		</description>
		<category>★아빠되기</category>
		<category>약</category>

		<comments>http://pallas.egloos.com/1732566#comments</comments>
		<pubDate>Thu, 27 Mar 2008 06:03:23 GMT</pubDate>
		<dc:creator>空想</dc:creator>
	</item>
	<item>
		<title><![CDATA[ [유니코드] 유틸리티 ]]> </title>
		<link>http://pallas.egloos.com/1306137</link>
		<guid>http://pallas.egloos.com/1306137</guid>
		<description>
			<![CDATA[ 
  <strong><span style="FONT-SIZE: 130%">Font properties extension, version 2.1</span></strong><br />
<a href="http://www.microsoft.com/typography/TrueTypeProperty21.mspx">http://www.microsoft.com/typography/TrueTypeProperty21.mspx</a>&nbsp;(<a href="http://pds1.egloos.com/pds/1/200604/14/05/ttfext.exe">ttfext.exe</a>)<br />
<br />
트루타입 폰트의 정보를 보다 자세히 보여준다.<br />
기본 정보외에 지원되는 코드페이지등 유용한 정보를 포함하고 있다.<br />
<div style="text-align:center"><img class="image_mid" border="0" onmouseover="this.style.cursor='pointer'" alt="" src="http://pds1.egloos.com/pds/1/200604/14/05/a0001305_16494666.gif" width="370" height="224" onclick="Control.Modal.openDialog(this, event, 'http://pds1.egloos.com/pds/1/200604/14/05/a0001305_16494666.gif');" /></div><br />
<br />
<br />
<span style="FONT-SIZE: 130%"><strong>Unibook Character browser Version 4.1.0</strong></span><br />
<a href="http://www.unicode.org/unibook/">http://www.unicode.org/unibook/</a>&nbsp;(<a href="http://pds2.egloos.com/pds/1/200604/14/05/Unibook-4.1.0.zip">Unibook-4.1.0.zip</a>)<br />
<br />
폰트내 문자를 코드값과 함께 확인할 수 있다. 문자표보다는 훨씬 편하다.<br />
<br />
<div style="text-align:center"><img class="image_mid" border="0" onmouseover="this.style.cursor='pointer'" alt="" src="http://pds1.egloos.com/pds/1/200604/14/05/a0001305_16584240.jpg" width="420" height="348" onclick="Control.Modal.openDialog(this, event, 'http://pds1.egloos.com/pds/1/200604/14/05/a0001305_16584240.jpg');" /></div><br />
<br /><br />			 ]]> 
		</description>
		<category>▶프로그래밍</category>

		<comments>http://pallas.egloos.com/1306137#comments</comments>
		<pubDate>Fri, 14 Apr 2006 08:00:06 GMT</pubDate>
		<dc:creator>空想</dc:creator>
	</item>
	<item>
		<title><![CDATA[ 준우의 돌잔치 ]]> </title>
		<link>http://pallas.egloos.com/1303128</link>
		<guid>http://pallas.egloos.com/1303128</guid>
		<description>
			<![CDATA[ 
  돌잔치는 무사히 잘 끝났다.<br />
그런데, 카메라를 동생에게 맡긴다는 것을 깜빡 잊는 바람에 사진을 못 찍었다. TT<br />
스튜디오에서 나오신 분이 스냅사진을 찍기로 해서 몇 장은 건질 수 있겠지만 찾아오신 분들과 자연스럽게 찍은 사진들은 거의 없을 것 같다. 어떻게 이런 실수를..<div style="text-align:center"><img class="image_mid" border="0" onmouseover="this.style.cursor='pointer'" alt="" src="http://pds2.egloos.com/pds/1/200604/10/05/a0001305_18221742.jpg" width="408" height="308" onclick="Control.Modal.openDialog(this, event, 'http://pds2.egloos.com/pds/1/200604/10/05/a0001305_18221742.jpg');" /></div><a href="http://madchick.egloos.com/">미친병아리</a>가 찍어준 사진. 땡큐~<br />
<br />
<br />
<div style="text-align:center"><img class="image_mid" border="0" onmouseover="this.style.cursor='pointer'" alt="" src="http://pds1.egloos.com/pds/1/200604/10/05/a0001305_18244858.jpg" width="400" height="300" onclick="Control.Modal.openDialog(this, event, 'http://pds1.egloos.com/pds/1/200604/10/05/a0001305_18244858.jpg');" /></div>아내의 친구가 찍어준 돌잡이 사진.. 많이 흔들렸지만 워낙 사진이 없어서..<br />
<br />
<p>이 녀석, 돈을 집었으면 했는데, 쌀을 집었다. 집에서 튀밥 집어먹는 것을 너무 좋아하더니 튀밥처럼 보였나 보다. 뭘 집던 어떠랴. 건강하게만 자라다오~</p><br /><br />			 ]]> 
		</description>
		<category>★아빠되기</category>

		<comments>http://pallas.egloos.com/1303128#comments</comments>
		<pubDate>Mon, 10 Apr 2006 09:33:29 GMT</pubDate>
		<dc:creator>空想</dc:creator>
	</item>
	<item>
		<title><![CDATA[ 인텔 맥에서 XP를 돌리다. ]]> </title>
		<link>http://pallas.egloos.com/1301049</link>
		<guid>http://pallas.egloos.com/1301049</guid>
		<description>
			<![CDATA[ 
  <a title="" href="http://bikblog.egloos.com/1300422">인텔 맥에서 XP를 돌린다!</a> <br />
<br />
맥에서 PC를.. PC에서 맥을..<br />
이제 좀 맥과 친해질 수 있을까..<br /><br />			 ]]> 
		</description>
		<category>▶주절주절</category>

		<comments>http://pallas.egloos.com/1301049#comments</comments>
		<pubDate>Fri, 07 Apr 2006 04:38:59 GMT</pubDate>
		<dc:creator>空想</dc:creator>
	</item>
	<item>
		<title><![CDATA[ [유니코드] 간단한 문자 출력 테스트 ]]> </title>
		<link>http://pallas.egloos.com/1299769</link>
		<guid>http://pallas.egloos.com/1299769</guid>
		<description>
			<![CDATA[ 
  <span style="FONT-FAMILY: Sans-Serif">먼저 <a href="http://pallas.egloos.com/1300407">기본언어판</a>의 문자를 출력해 보자.</span><br />
<span style="FONT-FAMILY: Arial"></span><br />
<span style="FONT-FAMILY: Sans-Serif">dc.TextOut(0, 0, 0xac00);</span><br />
<span style="FONT-FAMILY: Sans-Serif"></span>&nbsp;<br />
<span style="FONT-FAMILY: Sans-Serif">CString&nbsp;s = L"가";<br />
TRACE(L"%x", s.GetAt(0));</span><br />
<br />
첫번째 라인은 화면에 '가'를 출력할 것이고,<br />
두번째 이후는 0xac00를 디버그창에 출력할 것이다.<br />
<br />
어렵지 않다.<br />
<br />
<br />
그럼 이제 확장영역인 <a href="http://pallas.egloos.com/1300407">보충언어판</a>(Supplementary Plane)에 있는 문자를 출력해 보자.<br />
<br />
보충언어판의 맨앞의 문자인 00010000을 출력하기 위해..<br />
<br />
dc.TextOut(0, 0, 0x00010000);<br />
<br />
이렇게 하고 싶지만, 되지 않는다.<br />
<br />
유니코드용 문자열은 2바이트 기반이기 때문에 보충언어판의 4바이트 기반의 코드값을 바로 사용할 수는 없다. 이미 언급했듯이, 보충언어판의 문자를 출력하기 위해서는 <a href="http://pallas.egloos.com/1300407">대행코드</a>를 이용해야 한다. 올바른 결과를 얻기 위해서는 다음과 같이 수정해야 한다.<br />
<br />
wchar_t c[3] = {0xd800, 0xdc00, 0};<br />
dc.TextOut(0, 0, c);<br />
<br />
다시말해 UTF32형태의 0001000 값은 UTF16형태의 d800과 dc00 값으로 변환되어야 한다<br />
인코딩 관련 소스는 <a href="http://www.unicode.org/Public/PROGRAMS/CVTUTF/">http://www.unicode.org/Public/PROGRAMS/CVTUTF/</a> 에서 참고할 수 있다. (<a href="http://pds1.egloos.com/pds/1/200604/06/05/UTFConv.zip">UTFConv.zip</a>) <br />
<br />
마지막으로, 한가지 작업이 더 남았다.<br />
위 샘플은 아무것도 출력하지 못하는데, 이유는 폰트가 없기 때문이다.<br />
보충언어판 1의 폰트는 CODE2001.TTF, 보충언어판 2의 폰트는 CODE2002.TTF로 확인해 볼 수 있다. (<a href="http://pallas.egloos.com/1299729">폰트참고</a>)<br />
<br />
최종샘플이다.<br />
<br />
CFont font;<br />
font.CreatePointFont(200, _T("Code2001"));<br />
CFont* pold = dc.SelectObject(&amp;font);<br />
<br />
wchar_t c[3] = {0xd800, 0xdc00, 0};<br />
dc.TextOut(0, 0, c);<br />
<br />
dc.SelectObject(pold);<br />
font.DeleteObject(); <br /><br />			 ]]> 
		</description>
		<category>▶프로그래밍</category>

		<comments>http://pallas.egloos.com/1299769#comments</comments>
		<pubDate>Thu, 06 Apr 2006 07:33:00 GMT</pubDate>
		<dc:creator>空想</dc:creator>
	</item>
	<item>
		<title><![CDATA[ [유니코드] 기본언어판, 보충언어판 그리고 대행코드 ]]> </title>
		<link>http://pallas.egloos.com/1300407</link>
		<guid>http://pallas.egloos.com/1300407</guid>
		<description>
			<![CDATA[ 
  <span style="FONT-SIZE: 130%"><strong>기본 언어판 (기본 다국어 언어판)</strong></span><br />
<br />
줄여서 보통 BMP(Basic Multilingual Plane)로 표현한다. 비트맵이 아니다.<br />
0x0000 - 0xFFFF 까지의 영역을 표현.<br />
2바이트로 2^16, 즉 65,536개의 문자를 표현할 수 있다.<br />
<br />
<br />
<strong><span style="FONT-SIZE: 130%">보충 언어판</span></strong><br />
<br />
Supplementary Plane이라고&nbsp;한다. 16개의 언어판이 존재한다.<br />
<br />
이전에도 <a href="http://pallas.egloos.com/1300305">언급</a>했듯이 한자만 보더라도 기본 언어판으로는 세상의 모든 언어를 감당하기는 힘들다. 그래서 유니코드 3.0 부터는 보충 언어판을 정의했는데 예상대로 한자가 4만여자로 가장 많이 할당받았으며 그 밖에도 음악관련 기호, 수학용 문자및 기호등이 더 추가되었다.<br />
<br />
0x00010000 - 0x0001FFFF 보충 언어판 (Supplementary Multilingual Plane)<br />
0x00020000 - 0x0002FFFF 보충 표의문자판 (추가 한자영역)<br />
0x00030000 - 0x000DFFFF 아직 사용안함<br />
0x000E0000 - 0x000EFFFF 특별 보충판<br />
0x000F0000 - 0x0010FFFF 사용자 영역<br />
<br />
그렇다면, 보충언어판의 문자는 어떻게 <a href="http://pallas.egloos.com/1299769">표현</a>해야 하는가 궁금해 진다.<br />
유니코드용 문자열은 2바이트 기반의 wchar_t를 사용하는데, 보충언어판의 문자의 코드값은 이미 2바이트 범주를 넘어서지 않았는가..<br />
여기서 부터, 골아픈 문제들이 다시 시작하게 된다.<br />
이를 해결하기 위해, 기본 언어판에는 대행코드 영역이라는 것이 있는데 상위 대행코드와 하위 대행코드를 조합해서 보충언어판의 문자를 표현하자는 것이다.<br />
결국 2바이트가 꼭 한개의 문자를 의미하는 것이 될 수 없다. 한개를 읽어보고 대행코드이면 한개를 더 읽어 한 문자를 완성해야 한다. 이는 마치 DBCS를 판단하기 위해 했던 짓과 거의 동일한 짓을 해야만 한다는 것을 의미한다.<br />
<br />
기본 언어판의 대행코드 영역은 다음과 같다.<br />
<br />
상위 대행코드 (High Surrogates) : D800 - DBFF<br />
하위 대행코드 (Low Surrogates) : DC00 - DFFF<br />
<br />
1024개의 상위 대행코드와 1024개의 하위 대행코드가 조합될 수 있으므로, 2^10 x 2^10, 즉 2^20개의 코드를 표현할 수 있다. 이것을 다시 표현해 보면 2^4 x 2^16으로, 위에서 언급했듯이 16개의 보충언어판을 표현할 수 있는 것이다. <br /><br />			 ]]> 
		</description>
		<category>▶프로그래밍</category>

		<comments>http://pallas.egloos.com/1300407#comments</comments>
		<pubDate>Wed, 05 Apr 2006 05:38:23 GMT</pubDate>
		<dc:creator>空想</dc:creator>
	</item>
	<item>
		<title><![CDATA[ 돌잔치 초대장 ]]> </title>
		<link>http://pallas.egloos.com/1298733</link>
		<guid>http://pallas.egloos.com/1298733</guid>
		<description>
			<![CDATA[ 
  준우가 드뎌 첫돌을 맞이합니다.<br />
<div style="text-align:center"><img class="image_mid" border="0" onmouseover="this.style.cursor='pointer'" alt="" src="http://pds2.egloos.com/pds/1/200604/04/05/a0001305_10323583.jpg" width="500" height="707.258064516" onclick="Control.Modal.openDialog(this, event, 'http://pds2.egloos.com/pds/1/200604/04/05/a0001305_10323583.jpg');" /></div> <br />
<p>초대장에 날짜가 잘못되었네요. 2006년인데..</p><p>&nbsp;</p><div style="text-align:center"><img class="image_mid" border="0" onmouseover="this.style.cursor='pointer'" alt="" src="http://pds1.egloos.com/pds/1/200604/04/05/a0001305_1040057.jpg" width="500" height="707" onclick="Control.Modal.openDialog(this, event, 'http://pds1.egloos.com/pds/1/200604/04/05/a0001305_1040057.jpg');" /></div><br />
<div style="text-align:center"><img class="image_mid" border="0" onmouseover="this.style.cursor='pointer'" alt="" src="http://pds2.egloos.com/pds/1/200604/04/05/a0001305_1041096.jpg" width="500" height="707" onclick="Control.Modal.openDialog(this, event, 'http://pds2.egloos.com/pds/1/200604/04/05/a0001305_1041096.jpg');" /></div> <br /><br />			 ]]> 
		</description>
		<category>★아빠되기</category>

		<comments>http://pallas.egloos.com/1298733#comments</comments>
		<pubDate>Tue, 04 Apr 2006 01:33:25 GMT</pubDate>
		<dc:creator>空想</dc:creator>
	</item>
	<item>
		<title><![CDATA[ [유니코드] 한글과 한자 영역 ]]> </title>
		<link>http://pallas.egloos.com/1300305</link>
		<guid>http://pallas.egloos.com/1300305</guid>
		<description>
			<![CDATA[ 
  <strong><span style="FONT-SIZE: 130%">한글</span></strong><br />
<br />
현대한글은 초성(19개), 중성(21개), 종성(28개)로 총 11,172자가 조합되어 나올 수 있으며, 유니코드의 AC00 - D7AF 영역에 모든 조합가능한 문자가 완성되어 배열되어 있다.<br />
하지만, 옛한글을 포함한다면 초성(90개), 중성(66개), 종성(82자), 채움(2자)로 대략 50만자가 조합되어 나올 수 있는데 말이 50만자이지 50만자를 유니코드에 포함시킨다는 것은 사실상 불가능에 가깝다. 그래서 1100 - 11FF 영역에는 조합이 가능한&nbsp;자모 240개만이 배열되어 있다.<br />
결국, 유니코드는 한글 표현을 위해 완성형(유니완성형)과 조합형(유니조합형) 두 가지 모두 처리할 수 있도록 지원하고 있는 셈이다.<br />
<br />
좀 더 자세한 정보는, <a href="http://www.copyeditor.co.kr/reference/char-font/johabwansung.htm">한글 및 한국어 정보 처리 코드</a>&nbsp;(<a href="http://pds1.egloos.com/pds/1/200604/06/05/backup.zip">backup.zip</a>)에서 얻을 수 있다.<br />
완성형에서 유니코드까지의 한글코드 변천과정및 문제점등 전반적인 내용을 확인해 볼 수 있는 곳이다.<br />
<br />
이 밖에, 3130 - 318F 영역에 또다른 한글자모를 볼 수 있는데 이곳은 기존 한글완성형 코드에 있던 자모와의 호환을 위해 배치된 것이다.<br />
<br />
<br />
<strong><span style="FONT-SIZE: 130%">한자</span></strong><br />
<br />
정확한 총 개수는 알 수 없으나, 실제로 사용되는 것은 3,000자 내외라고 한다.<br />
유니코드의 기본언어판에는 약 2만여자가 포함되어 있으며,&nbsp;4E00 - 9FFF 영역에 배열되어 있다. (유니코드 3.1 이후에는 약 4만여자가 <a href="http://pallas.egloos.com/1300407">보충언어판</a>에 더 추가되었다.)<br />
<br />
◆편해(篇海): 금(金)왕조시대의 자전 54,000자 수록<br />
◆해편(海篇): 명(明)왕조 시대의 자전 54,000자 수록<br />
◆강희자전(康熙字典): 청(淸)왕조 시대의 자전 47,000 자 수록<br />
◆대한화사전(大漢和辭典): 현대 일본 사전 50,000자 수록<br />
◆<strong>한어대자전</strong>(漢語大字典): 현대 중국 사전 56,000자 수록<br />
◆중화자해(中華字海): 현대 중국 자전 85,000자 수록<br />
◆금석문자경(今昔文字鏡): 현대 중국 자전 85,000자 수록 <br /><br />			 ]]> 
		</description>
		<category>▶프로그래밍</category>

		<comments>http://pallas.egloos.com/1300305#comments</comments>
		<pubDate>Mon, 03 Apr 2006 03:07:43 GMT</pubDate>
		<dc:creator>空想</dc:creator>
	</item>
	<item>
		<title><![CDATA[ [유니코드] 문자및 폰트 참고에 유용한 곳 ]]> </title>
		<link>http://pallas.egloos.com/1299729</link>
		<guid>http://pallas.egloos.com/1299729</guid>
		<description>
			<![CDATA[ 
  <span style="FONT-SIZE: 130%"><strong>FileFormat.Info</strong></span><br />
<a href="http://www.fileformat.info/info/unicode/index.htm">http://www.fileformat.info/info/unicode/index.htm</a><br />
<a href="http://www.fileformat.info/info/unicode/char/search.htm">http://www.fileformat.info/info/unicode/char/search.htm</a><br />
<br />
보고자 하는 문자의 코드값을 직접 입력하면, 실제 문자의 모양과&nbsp;그 문자를 포함하고 있는 폰트등의 정보를 알 수 있다. 그 밖에도 많은 정보를 포함한다. 아주 유용한 사이트임.<br />
<br />
<br />
<span style="FONT-SIZE: 130%"><strong>Unicode Font</strong></span><br />
<a href="http://home.att.net/~jameskass/">http://home.att.net/~jameskass/</a><br />
<br />
유니코드에는 아직도 코드값은 부여받았지만 실제 확인해 볼 수 없는 문자들이 상당히 많다.<br />
특히, 유니코드 3.0부터 정의된 <a href="http://pallas.egloos.com/1300407">보충언어판</a>이라 불리우는 확장영역(Supplementary Planes)의 문자들은 대부분 없다.<br />
하지만, 이곳에서는 전부는 아니지만 상당부분을 확인해 볼 수 있는 폰트를 다운받을 수 있다.<br />
<br />
<a href="http://pds2.egloos.com/pds/1/200604/05/05/CODE2000.ZIP">CODE2000.ZIP</a> : Shareware demo Unicode font (v1.15)<br />
<a href="http://pds2.egloos.com/pds/1/200604/05/05/CODE2001.ZIP">CODE2001.ZIP</a> : beta test font for Plane 1<br />
<a href="http://pds2.egloos.com/pds/1/200604/05/05/CODE2002.ZIP">CODE2002.ZIP</a> : beta test font for Plane 2 <br /><br />			 ]]> 
		</description>
		<category>▶프로그래밍</category>

		<comments>http://pallas.egloos.com/1299729#comments</comments>
		<pubDate>Sun, 02 Apr 2006 07:05:45 GMT</pubDate>
		<dc:creator>空想</dc:creator>
	</item>
	<item>
		<title><![CDATA[ [유니코드] ANSI version과 같이 사용할 때 메모리릭 문제 ]]> </title>
		<link>http://pallas.egloos.com/1299794</link>
		<guid>http://pallas.egloos.com/1299794</guid>
		<description>
			<![CDATA[ 
  <a href="http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B167929">Memory leaks are reported when you use multiple MFC DLLs</a><br />
<br />
유니코드(UNICODE)로 빌드된 DLL, 그리고 비유니코드(ANSI)로 빌드된 어플리케이션.<br />
어플리케이션에서 유니코드용 DLL을 LoadLibrary한 후, FreeLibrary만 하면 이상하게 메모리가 줄줄 샌다.<br />
아무짓도 안하고 단지 LoadLibrary와 FreeLibrary만 해도 샌다.<br />
<br />
이밖에도, <br />
MFC42d.DLL, MFC40d.DLL와 같이 다른 버전을 섞어서 사용해도 같은 문제가 발생한다.<br />
<br />
결론부터 말하면, 잘못된 경고이므로 무시해도 된다.<br />
<br />
FreeLibrary할 때, 메모리릭이 발생하므로,<br />
ExitInstance를 다음과 같이 override해서 진짜 릭(Leak)과 가짜 릭을 구분하라고 권장하고 있다.<br />
<br />
int CTestDllApp::ExitInstance()<br />
{<br />
TRACE(_T("ExitInstance() for regular DLL: TESTDLL
"));<br />
return CWinApp::ExitInstance();<br />
} <br /><br /><p>-----------------------------------------------------------</p><p>Memory leaks are reported when you use multiple MFC DLLs</p><p>Article ID : 167929 <br />
Last Review : June 6, 2005 <br />
Revision : 4.0 <br />
This article was previously published under Q167929</p><p>SYMPTOMS<br />
When you debug a project that contains MFC regular (USRDLL) DLLs or ActiveX Controls (OCX), you may see memory leaks similar to the following reported in the debugger:&nbsp;&nbsp;&nbsp; <br />
a CDynLinkLibrary object at $00410F70, 64 bytes long<br />
a CDynLinkLibrary object at $00410F70, 64 bytes long<br />
{38} client block at 0x00410D80, subtype 0, 64 bytes long.<br />
a CDynLinkLibrary object at $00410D80, 64 bytes long<br />
a CDynLinkLibrary object at $00410D80, 64 bytes long<br />
{36} client block at 0x00410C60, subtype 0, 64 bytes long.<br />
a CDynLinkLibrary object at $00410C60, 64 bytes long<br />
a CDynLinkLibrary object at $00410C60, 64 bytes long<br />
<br />
CAUSE<br />
These memory leaks are reported when multiple versions of the MFC DLL are loaded in the same process. Since MFC extension (AFXDLL) DLLs require the exact same MFC DLL as the call application, this problem can only occur when using MFC regular (USRDLL) DLLs or ActiveX Controls (OCX) that use the shared version of MFC. </p><p>The most common case is mixing ANSI (MFC4xd.DLL) and UNICODE (MFC4xxUd.DLL) versions of MFC in the same process. This can also occur when mixing MFC42d.DLL and MFC40d.DLL. </p><p>RESOLUTION<br />
These memory leak notifications are false, and can be ignored. Since neither copy of MFC knows about the other ones, it's not easy to stop these false leaks from being reported. However, it is possible to separate the false leaks from the potential real leaks. This can be done by overriding CWinApp::ExitInstance() in both the EXE and DLL and placing TRACE() statements in them:&nbsp;&nbsp;&nbsp; </p><p>&nbsp;&nbsp; int CTestDllApp::ExitInstance()<br />
{<br />
 TRACE(_T("ExitInstance() for regular DLL: TESTDLL
"));<br />
 return CWinApp::ExitInstance();<br />
}<br />
<br />
Only the memory leaks that are detected after the last CWinApp::ExitInstance() is called are true memory leaks. </p><p>STATUS<br />
This behavior is by design. </p><p>MORE INFORMATION<br />
Consider the following application/DLLs: <br />
-------------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --------------<br />
=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =<br />
=&nbsp;&nbsp; MFC&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp;&nbsp; Calls&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp;&nbsp; MFC&nbsp;&nbsp;&nbsp;&nbsp; =<br />
=&nbsp;&nbsp; APP&nbsp;&nbsp;&nbsp;&nbsp; = ------------&gt; =&nbsp;&nbsp; USRDLL&nbsp;&nbsp; =<br />
=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =<br />
=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp; MSVCR40d =<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp; (CRT)&nbsp;&nbsp; =<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -------------<br />
<br />
The MFC Application that is built with the ANSI (MFC40d.DLL) version of MFC calls the MFC USRDLL, which is built with the UNICODE (MFC40Ud.DLL) version of MFC. Both MFC versions use the same C run-time (CRT) DLL, MSVCR40d.DLL. Since MFC USRDLLs are "black-boxes", there should be no problems with calling a UNICODE MFC USRDLL from an ANSI MFC Application. </p><p>However, since the UNICODE (MFC40ud.DLL) and ANSI (MFC40d.DLL) MFC DLLs both use the same CRT DLL, false memory leaks are reported on all the objects allocated in the MFC USRDLL. This occurs because MFC relies on the CRT DLL to allocate and track all memory. It does not separate the memory allocations from the different versions of MFC. When one of the MFC DLLs unloads, it calls the CRT to do a memory dump, assuming everything left in the heap is a memory leak. However, this assumption is incorrect since there are two multiple copies of MFC in memory. </p><p>(c) Microsoft Corporation 1997, All Rights Reserved. Contributions by Kelly Marie Ward, Microsoft Corporation. </p><p>--------------------------------------------------------------------------------<br />
</p>			 ]]> 
		</description>
		<category>▶프로그래밍</category>

		<comments>http://pallas.egloos.com/1299794#comments</comments>
		<pubDate>Sat, 01 Apr 2006 08:10:00 GMT</pubDate>
		<dc:creator>空想</dc:creator>
	</item>
</channel>
</rss>
