ホーム » 2013 » 10月 » 31

日別アーカイブ: 2013/10/31

2013年10月
 12345
6789101112
13141516171819
20212223242526
2728293031  

カテゴリー

アーカイブ

ブログ統計情報

  • 79,655 アクセス



.NET と Win32 API

HDC の利用
IntPtr のまま与えてしまうと,
  c:\…\Form1.h(156) : error C2664: ‘DrawText’ : 1 番目の引数を ‘System::IntPtr’ から ‘HDC’ に変換できません。


  IntPtr pDC = e->Graphics->GetHdc() ;
  HDC hDC = static_cast(pDC.ToPointer()) ;
// DrawText(hDC, tstr.c_str(), -1, &rect, 0 );
  e->Graphics->ReleaseHdc(pDC) ;
ちょっと古いが,プログラミング Visual C++.NET Vol.2 P.459


コードを修正しビルドすると,
  ~.obj : error LNK2028: 未解決のトークン (0A00005B) …
  ~.obj : error LNK2019: 未解決の外部シンボル …
error LNK2028 LNK2019
「親または…」にチェックを入れる.

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.