ホーム » 2011 » 11月 » 02

日別アーカイブ: 2011/11/02

2011年11月
 12345
6789101112
13141516171819
20212223242526
27282930  

カテゴリー

アーカイブ

ブログ統計情報

  • 77,336 アクセス



GetLastError と FormatMessage

以前,以下を作成していた(Error.hxx)

inline	CString	Error::FormatMessage(const DWORD error)
{
	CString	message ;
	LPVOID	lpMessageBuffer = NULL ;
	if (::FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
		NULL,error,MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT),
		(LPTSTR)&lpMessageBuffer,0,NULL)) {
		message = LPTSTR(lpMessageBuffer) ;
		::LocalFree(lpMessageBuffer) ;
		}
	return	message ;
	}
Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.