①.RasEnumEntries
来源:互联网 发布:淘宝详情页抄袭 编辑:程序博客网 时间:2024/06/10 02:55
函数原型:
DWORD RasEnumEntries(
__in LPCTSTR reserved,
__in LPCTSTR lpszPhonebook,
__in_out LPRASENTRYNAME lprasentryname,
__in_out LPDWORD lpcb,
__out LPDWORD lpcEntries
);
先说下函数的功能:枚举指定Phone book的连接。
参数:
①。第一个MSDN的说明:
Reserved; must be NULL.
②。第二个指定Phone book,以后再追究。
(所以前2个都为NULL~)
③。指定一个缓冲。__in_out
in 方面:先看下RASENTRYNAME 的定义
typedef struct _RASENTRYNAME {
DWORD dwSize;
TCHAR szEntryName[RAS_MaxEntryName + 1];
#if (WINVER >= 0x500)
DWORD dwFlags;
TCHAR szPhonebookPath[MAX_PATH + 1];
#endif
} RASENTRYNAME;
再看MSDN解释:
an application must set the dwSize member of the first RASENTRYNAME structure in the buffer to sizeof(RASENTRYNAME) in order to identify the version of the structure being passed.
out 方面:
MSDN:
receives an array of RASENTRYNAME structures, one for each phone-book entry.
④。同样是 __in_out
in方面: contains the size, in bytes, of the buffer specified by lprasentryname.
(不会英语都看的懂了~)
out方面:不常用。
直接上解释:the function sets this variable to the number of bytes required to successfully complete the call.
⑤。
这个会用到。
结合返回值作用~后面说
Pointer to a variable that receives to the number of phone-book entries written to the buffer specified by lprasentryname.
返回值:
成功返回0
不成功只用管
ERROR_BUFFER_TOO_SMALL
意思是缓冲太小了
上面说到第五个参数结合返回值作用:
可以用来判断0个项的情况。
例子:
r代表返回值 第五个参数entries
if(r == 0)
{
if(entries > 0)
{
//有连接 拿去用
}
else
{
//无连接
}
}
- ①.RasEnumEntries
- RasEnumEntries
- C++ RasDial之调用RasEnumEntries遍历系统中存在的宽带连接名称
- C++ RasDial之调用RasEnumEntries遍历系统中存在的宽带连接名称
- 生活①
- JavaOO-①
- JAVA①
- Spring①
- ajax①
- 图论课次①
- 面向对象(①④-①⑤)
- 奇趣第①站
- 。系统美化 ① FAQ
- “狼”在黄金海岸①
- Java核心技术①
- FreeBSD入门①
- MFC深入浅出笔记 ①
- ①IO初步
- 立志:网络工程师
- 中国十大CEO
- 读《新帝国主义在中国》
- Suomsoft Web 技术实验室开张
- java拷贝对象
- ①.RasEnumEntries
- What is 老公!
- ubuntu9.04安装drcom
- 如何高效的預分配磁盤大小給文件
- dpc学习笔记
- TIMER
- ASP.NET的forms身份验证
- Windows Phone 7 Series 概述、亮点以及。。。。。。
- java网络原理