VB中的RasEnumConnections函数返回632错误解决方法
今天用了一下RasEnumConnections函数,发现MSDN上的例子是错误的。
MSDN上RasEnumConnections的文档是这么说的:
Todeterminetherequiredbuffersize,callRasEnumConnectionswithlprasconnsettoNULL.Thevariablepointedtobylpcbshouldbesettozero.ThefunctionwillreturntherequiredbuffersizeinlpcbandanerrorcodeofERROR_BUFFER_TOO_SMALL.
MSDN上提供的示例代码也是这么写的:
DWORD__cdeclwmain(){
DWORDdwCb=0; DWORDdwRet=ERROR_SUCCESS; DWORDdwConnections=0; LPRASCONNlpRasConn=NULL; dwRet=RasEnumConnections(lpRasConn,&dwCb,&dwConnections);
if(dwRet==ERROR_BUFFER_TOO_SMALL){ //...... }