# 有关 rasapi32.dll 的应用

Posted by Johnny Guo on April 15, 1998 at 08:10:15:

麻烦各位先进帮我检查一下我的 DLL宣告如下

Type RASENTRYNAME
dwsize As Long
szEntryName(RAS_MaxEntryName+1) as Byte
End Type

Public Declare Function RasEnumEntries& Lib "rasapi32" _
Alias "RasEnumEntriesA" (ByVal res As String, ByVal lpszPhonebook As String, _
lpRasEntryBuffer As RASENTRYNAME, lpcb As Long, lpcEntries As Long)

Private Sub GetRasNameEntries()
Dim Entry(0) As RASENTRYNAME
Dim di&, lpcb&, lpentries&
Dim phonebook As String
phonebook = mvarRasPhoneBookPath & "\" & "rasphone.pbk"
Entry(0).dwsize = Len(Entry(0))
lpcb = Len(Entry(0))

di& = RasEnumEntries(vbNullString, phonebook, Ent(0), lpcb, lpentries)
在我呼叫 RasEnumEntries 时总是告诉我结构不正确 (return值 = 632)
End Sub

Johnny Guo 1998/04/15 from Taipei

以下是 prototype
** ras.h
** Remote Access external API
** Public header for external API clients
**
** WINVER values in this file:
** WINVER 0x400 = Windows NT SUR enhancements

#if (WINVER >= 0x400)
#define RAS_MaxEntryName 256
#define RAS_MaxDeviceName 128
#define RAS_MaxCallbackNumber RAS_MaxPhoneNumber
#else
#define RAS_MaxEntryName 20
#define RAS_MaxDeviceName 32
#define RAS_MaxCallbackNumber 48
#endif

RASENTRYNAMEA
{
DWORD dwSize;
CHAR szEntryName[ RAS_MaxEntryName + 1 ];
};

DWORD APIENTRY RasEnumEntriesA( LPSTR, LPSTR, LPRASENTRYNAMEA, LPDWORD,
LPDWORD );

Follow Ups:

- Re: 有关 rasapi32.dll 的应用 cww 19:59:49 4/15/98 (0)