20180628

GetLastError

Last-Error Code
https://docs.microsoft.com/ja-jp/windows/desktop/Debug/last-error-code
When an error occurs, most system functions return an error code, usually 0, NULL, or –1. Many system functions also set an additional error code called the last-error code. This error code is maintained separately for each running thread; an error in one thread does not overwrite the last-error code in another thread. Any function can call the SetLastError or SetLastErrorEx function to set the last-error code for the current thread. These functions are intended primarily for dynamic-link libraries (DLL), so they can provide information to the calling application. Note that some functions call SetLastError or SetLastErrorEx with 0 when they succeed, wiping out the error code set by the most recently failed function, while others do not.


GetLastError

https://msdn.microsoft.com/ja-jp/library/cc428944.aspx
GetLastError
呼び出し側のスレッドが持つ最新のエラーコードを取得します。エラーコードは、スレッドごとに保持されるため、複数のスレッドが互いの最新のエラーコードを上書きすることはありません。

DWORD GetLastError(VOID);

応情報
Windows NT/2000:Windows NT 3.1 以降
Windows 95/98:Windows 95 以降
ヘッダー:Winbase.h 内で宣言、Windows.h をインクルード
インポートライブラリ:Kernel32.lib を使用

参照
FormatMessage, SetLastError, SetLastErrorEx


getlasterror 使い方

formatmessage 改行

formatmessage 使い方

getlasterror エラーコード

formatmessage getlasterror

formatmessage error

formatmessage 英語

mfc formatmessage

hresult formatmessage

getlasterror c++
--

注目の投稿

Thunderbird Setup 115.9.0.exe 更新失敗 起動できない

Thunderbird Setup 115.9.0.exe Thunderbird Setup 115.9.0.exe 更新失敗 起動できない えくせる webservice windowas7 internetexplorer 戻り値 windows7 edgeを優先 【外部リ...

人気の投稿