typedef struct tagRASENTRY {
  DWORD      dwSize;
  DWORD      dwfOptions;
  //
  // Location/phone number.
  //
  DWORD      dwCountryID;
  DWORD      dwCountryCode;
  TCHAR      szAreaCode[ RAS_MaxAreaCode + 1 ];
  TCHAR      szLocalPhoneNumber[ RAS_MaxPhoneNumber + 1 ];
  DWORD      dwAlternateOffset;
  //
  // PPP/Ip
  //
  RASIPADDR  ipaddr;
  RASIPADDR  ipaddrDns;
  RASIPADDR  ipaddrDnsAlt;
  RASIPADDR  ipaddrWins;
  RASIPADDR  ipaddrWinsAlt;
  //
  // Framing
  //
  DWORD      dwFrameSize;
  DWORD      dwfNetProtocols;
  DWORD      dwFramingProtocol;
  //
  // Scripting
  //
  TCHAR      szScript[ MAX_PATH ];
  //
  // AutoDial
  //
  TCHAR       szAutodialDll[ MAX_PATH ];
  TCHAR       szAutodialFunc[ MAX_PATH ];
  //
  // Device
  //
  TCHAR      szDeviceType[ RAS_MaxDeviceType + 1 ];
  TCHAR      szDeviceName[ RAS_MaxDeviceName + 1 ];
  //
  // X.25
  //
  TCHAR      szX25PadType[ RAS_MaxPadType + 1 ];
  TCHAR      szX25Address[ RAS_MaxX25Address + 1 ];
  TCHAR      szX25Facilities[ RAS_MaxFacilities + 1 ];
  TCHAR      szX25UserData[ RAS_MaxUserData + 1 ];
  DWORD      dwChannels;
  //
  // Reserved
  //
  DWORD       dwReserved1;
  DWORD       dwReserved2;
#if (WINVER >= 0x401)
  //
  // Multilink and BAP
  //
  DWORD       dwSubEntries;
  DWORD       dwDialMode;
  DWORD       dwDialExtraPercent;
  DWORD       dwDialExtraSampleSeconds;
  DWORD       dwHangUpExtraPercent;
  DWORD       dwHangUpExtraSampleSeconds;
  //
  // Idle time out
  //
  DWORD       dwIdleDisconnectSeconds;
#endif
#if (WINVER >= 0x500)
  DWORD     dwType;               // entry type
  DWORD     dwEncryptionType;     // type of encryption to use
  DWORD     dwCustomAuthKey;      // authentication key for EAP
  GUID      guidId;               // guid that represents 
                                  // the phone-book entry 
  TCHAR    szCustomDialDll[MAX_PATH];    // DLL for custom dialing 
  DWORD    dwVpnStrategy;         // specifies type of VPN protocol 
#endif
#if (WINVER >= 0x501)
  DWORD     dwfOptions2;
  DWORD     dwfOptions3;
  TCHAR     szDnsSuffix[RAS_MaxDnsSuffix];
  DWORD     dwTcpWindowSize;
  TCHAR     szPrerequisitePbk[MAX_PATH];
  TCHAR     szPrerequisiteEntry[RAS_MaxEntryName + 1];
  DWORD     dwRedialCount;
  DWORD     dwRedialPause;
#endif
} RASENTRY;
哪位大哥能帮忙吧这个结构声明成VB里的TYPE啊?好多类型不知道怎么转到VB里,请高手指教

解决方案 »

  1.   

    API parameter typesC language data type In Visual Basic declare as Call with ATOM      ByVal variable As Integer An expression that evaluates to an Int. BOOL      ByVal variable As Long An expression that evaluates to a Long BYTE      ByVal variable As Byte An expression that evaluates to a Byte CHAR      ByVal variable As Byte An expression that evaluates to a Byte COLORREF  ByVal variable As Long An expression that evaluates to a Long DWORD     ByVal variable As Long An expression that evaluates to a Long HWND, HDC, HMENU, etc. (Windows handles) ByVal variable As Long An expression that evaluates to a Long INT, UINT ByVal variable As Long An expression that evaluates to a Long LONG      ByVal variable As Long An expression that evaluates to a Long LPARAM    ByVal variable As Long An expression that evaluates to a Long LPDWORD   variable As Long An expression that evaluates to a Long LPINT, LPUINT variable As Long An expression that evaluates to a Long LPRECT variable As type Any variable of that user-defined type LPSTR, LPCSTR ByVal variable As String An expression that evaluates to a String LPVOID variable As Any Any variable (use ByVal when passing a string) LPWORD variable As Integer An expression that evaluates to an Int. LRESULT ByVal variable As Long An expression that evaluates to a Long NULL As Any or ByVal variable As Long ByVal Nothing or ByVal 0& or vbNullString SHORT     ByVal variable As Integer An expression that evaluates to an Int. VOID      Sub procedure Not applicable WORD      ByVal variable As Integer An expression that evaluates to an Int. WPARAM    ByVal variable As Long An expression that evaluates to a Long 
      

  2.   

    Public Type RASIPADDR
        a As Byte
        b As Byte
        c As Byte
        d As Byte
    End TypePublic Enum RasEntryOptions
       RASEO_UseCountryAndAreaCodes = &H1
       RASEO_SpecificIpAddr = &H2
       RASEO_SpecificNameServers = &H4
       RASEO_IpHeaderCompression = &H8
       RASEO_RemoteDefaultGateway = &H10
       RASEO_DisableLcpExtensions = &H20
       RASEO_TerminalBeforeDial = &H40
       RASEO_TerminalAfterDial = &H80
       RASEO_ModemLights = &H100
       RASEO_SwCompression = &H200
       RASEO_RequireEncryptedPw = &H400
       RASEO_RequireMsEncryptedPw = &H800
       RASEO_RequireDataEncryption = &H1000
       RASEO_NetworkLogon = &H2000
       RASEO_UseLogonCredentials = &H4000
       RASEO_PromoteAlternates = &H8000
       RASEO_SecureLocalFiles = &H10000
       RASEO_RequireEAP = &H20000
       RASEO_RequirePAP = &H40000
       RASEO_RequireSPAP = &H80000
       RASEO_Custom = &H100000
       RASEO_PreviewPhoneNumber = &H200000
       RASEO_SharedPhoneNumbers = &H800000
       RASEO_PreviewUserPw = &H1000000
       RASEO_PreviewDomain = &H2000000
       RASEO_ShowDialingProgress = &H4000000
       RASEO_RequireCHAP = &H8000000
       RASEO_RequireMsCHAP = &H10000000
       RASEO_RequireMsCHAP2 = &H20000000
       RASEO_RequireW95MSCHAP = &H40000000
       RASEO_CustomScript = &H80000000
    End EnumPublic Enum RASNetProtocols
       RASNP_NetBEUI = &H1
       RASNP_Ipx = &H2
       RASNP_Ip = &H4
    End EnumPublic Enum RasFramingProtocols
       RASFP_Ppp = &H1
       RASFP_Slip = &H2
       RASFP_Ras = &H4
    End Enum
    Public Type VBRasEntry
       Options As RasEntryOptions
       CountryID As Long
       CountryCode As Long
       AreaCode As String
       LocalPhoneNumber As String
       AlternateNumbers As String
       ipAddr As RASIPADDR
       ipAddrDns As RASIPADDR
       ipAddrDnsAlt As RASIPADDR
       ipAddrWins As RASIPADDR
       ipAddrWinsAlt As RASIPADDR
       FrameSize As Long
       fNetProtocols As RASNetProtocols
       FramingProtocol As RasFramingProtocols
       ScriptName As String
       AutodialDll As String
       AutodialFunc As String
       DeviceType As String
       DeviceName As String
       X25PadType As String
       X25Address As String
       X25Facilities As String
       X25UserData As String
       Channels As Long
       NT4En_SubEntries As Long
       NT4En_DialMode As Long
       NT4En_DialExtraPercent As Long
       NT4En_DialExtraSampleSeconds As Long
       NT4En_HangUpExtraPercent As Long
       NT4En_HangUpExtraSampleSeconds As Long
       NT4En_IdleDisconnectSeconds As Long
       Win2000_Type As Long
       Win2000_EncryptionType As Long
       Win2000_CustomAuthKey As Long
       Win2000_guidId(0 To 15) As Byte
       Win2000_CustomDialDll As String
       Win2000_VpnStrategy As Long
    End Type
      

  3.   

    参考:
    http://home.iprimus.com.au/billmcc/PlatformVB/dun/rasentry.htm