ホーム » MFC » CFont::CreatePointFont でアサート

2012年3月
 123
45678910
11121314151617
18192021222324
25262728293031

カテゴリー

アーカイブ

ブログ統計情報

  • 77,340 アクセス



CFont::CreatePointFont でアサート

—————————
Microsoft Visual C++ Debug Library
—————————
Debug Assertion Failed!

Program: C:\WINDOWS\explorer.exe
File: wingdix.cpp
Line: 269

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.

(Press Retry to debug the application)
—————————
中止(A) 再試行(R) 無視(I)
—————————
CreatePointFont CMetaFile
ここ 1 年位のコードで何個かあったので,…
呼び元で与えられた pDC が CMetaFileDC の場合,m_hAttribDC が NULL となるため.
コードを書いた段階では画面やプリンタだったが,今回 Text → EMF で表面化した.
修正は以下の様な感じ.

//	font.CreatePointFont(120,faceName,pDC) ;
if (pDC->m_hAttribDC == NULL)	{   font.CreatePointFont(120,faceName,NULL) ;  }
else				{   font.CreatePointFont(120,faceName,pDC) ;   }
Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

コメントする

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

%d人のブロガーが「いいね」をつけました。