ホーム » MFC » GetLastError と FormatMessage

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

コメントする

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

© 2009-2026 mish.work All Rights Reserved.

Powered by WordPress / Academica WordPress Theme by WPZOOM