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) ;   }
カテゴリー: MFC, メモ パーマリンク

コメントを残す

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