网站首页  词典首页

请输入您要查询的函数:

 

术语 lstrlen
释义 lstrlen
语法:
int lstrlen( LPCTSTR lpString
);
lstrlen函数
这个函数返回的字节长度(ANSI版本)或宽字符值(Unicode版本)指定的字符串(不包括终止空字符)。
参数
lpString
[in]指向一个空结束的字符串。
返回值
返回值指定字符串的长度,在TCHAR值。这是指对功能或宽字符的ANSI版本字节Unicode版本的值。如果lpString为NULL,则返回值为0。
备注
安全警告:
使用此功能不当,可能会损害您的应用程序的安全。 lstrlen假定lpString是一个空结尾的字符串,或NULL。如果不是,这可能导致缓冲区溢出或服务对您的应用程序攻击。
考虑使用下列其中一个选择:StringCbLength或StringCchLength。
审查安全方面的考虑:Windows用户界面,然后继续。
Windows 95/98/Me的:虽然lstrlenW在Microsoft Windows 95/98/Me的存在,它是支持的Unicode(MSLU)微软层提供更一致的行为在所有的Windows操作系统。要使用此,您必须将某些文件到您的应用,概述了对Unicode的Microsoft层在Windows 95/98/Me系统。
例如
有关示例,请参见显示键盘输入。
功能信息
最低DLL版本 kernel32.dll
在Winbase.h HeaderDeclared,头文件:winuser.h
import libraryKernel32.lib
最低操作系统Windows 95,Windows NT 3.1
UnicodeImplemented为ANSI和Unicode版本。
参见
Strings 概述 ,StringCbLength,StringCchLength,lstrcat,lstrcmp,lstrcmpi,lstrcpy
==英文原文==lstrlen Function
This function returns the length in bytes (ANSI version) or WCHAR values (Unicode version) of the specified string (not including the terminating null character).
Syntax
int lstrlen( LPCTSTR lpString
);
Parameters
lpString
[in] Pointer to a null-terminated string.
Return Value
The return value specifies the length of the string, in TCHAR values. This refers to bytes for ANSI versions of the function or WCHAR values for Unicode versions. If lpString is NULL, the return value is 0.
Remarks
Security Alert
Using this function incorrectly can compromise the security of your application. lstrlen assumes that lpString is a null-terminated string, or NULL. If it is not, this could lead to a buffer overrun or a denial of service attack against your application.
Consider using one of the following alternatives: StringCbLength or StringCchLength .
Review Security Considerations: Windows User Interface before continuing.
Windows 95/98/Me: Although lstrlenW exists on Microsoft Windows 95/98/Me, it is supported by the Microsoft Layer for Unicode (MSLU) to give more consistent behavior across all Windows operating systems. To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems .
Example
For an example, see Displaying Keyboard Input .
Function Information
Minimum DLL Versionkernel32.dll
HeaderDeclared in Winbase.h, include Windows.h
Import libraryKernel32.lib
Minimum operating systemsWindows 95, Windows NT 3.1
UnicodeImplemented as ANSI and Unicode versions.
See Also
Strings Overview , StringCbLength , StringCchLength , lstrcat , lstrcmp , lstrcmpi , lstrcpy
==原始网址==http://msdn.microsoft.com/en-us/library/ms647492(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 9:18:59