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

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) ;   }
この投稿は役に立ちましたか ? 0 人中 0 人がこの 投稿 は役に立ったと言っています。

コメントする

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

© 2009-2026 mish.work All Rights Reserved.

Powered by WordPress / Academica WordPress Theme by WPZOOM