网站首页  词典首页

请输入您要查询的函数:

 

术语 setlasterror
释义 SetLastError
语法:
C++
void WINAPI SetLastError(
__in DWORD dwErrCode
);
SetLastError函数
该设置调用线程的最后错误代码。
参数
dwErrCode [in]
最后,为线程错误代码。
返回值
这个函数没有返回值。
备注
对最后的错误代码存放在线程本地存储,让多个线程不会覆盖彼此的价值观念。
大多数函数调用SetLastError或SetLastErrorEx只有当他们失败。然而,一些系统功能调用成功的条件下,SetLastError或SetLastErrorEx,这些案件在每个函数的文档指出。
应用程序可以选择立即检索功能失败后,该功能通过使用GetLastError函数值。
错误代码是32位值(31位,是最重要的位)。位29是保留给应用程序定义的错误代码,没有系统错误代码此位设置。如果要定义为您的应用程序错误代码,设置此位,以指示错误代码已经被定义为您的应用程序,并确保您的错误代码没有任何冲突,系统定义的错误代码。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
错误处理函数
GetLastError函数
最后,错误代码
SetLastErrorEx
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月30日
==英文原文==SetLastError Function
Sets the last-error code for the calling thread.
Syntax
C++
void WINAPI SetLastError(
__in DWORD dwErrCode
);
Parameters
dwErrCode [in]
The last-error code for the thread.
Return Value
This function does not return a value.
Remarks
The last-error code is kept in thread local storage so that multiple threads do not overwrite each other's values.
Most functions call SetLastError or SetLastErrorEx only when they fail. However, some system functions call SetLastError or SetLastErrorEx under conditions of success; those cases are noted in each function's documentation.
Applications can optionally retrieve the value set by this function by using the GetLastError function immediately after a function fails.
Error codes are 32-bit values (bit 31 is the most significant bit). Bit 29 is reserved for application-defined error codes; no system error code has this bit set. If you are defining an error code for your application, set this bit to indicate that the error code has been defined by your application and to ensure that your error code does not conflict with any system-defined error codes.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
Error Handling Functions
GetLastError
Last-Error Code
SetLastErrorEx
Send comments about this topic to Microsoft
Build date: 7/30/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms680627(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:19:55