有問題求教
我用的是,想用如下代碼實現獲得本地计算机上的拨号网络的项目Public Class Form1
Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" ( _
ByVal bKey As Integer, ByVal lpSubKey As String, ByRef phkResult As Integer) As Integer
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Integer) As Integer
Private Declare Function RegEnumKey Lib "advapi32.dll" Alias _
"RegEnumKeyA" (ByVal hKey As Integer, ByVal dwIndex As Integer, ByVal _
lpName As String, ByVal chName As Integer) As Integer
Const HKEY_CURRENT_USER As Integer = &H80000001
Const ERROR_NO_MORE_ITEMS As Short = 259
Const ERROR_SUCCESS As Short = 0
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim hKey As Integer
Dim i As Integer
'Dim astr As VBFixedStringAttribute
Dim astr As VB6.fixedLengthString = New VB6.fixedLengthstring(256)
If RegOpenKey(HKEY_CURRENT_USER, "RemoteAccess\Profile", hKey) = ERROR_SUCCESS Then
While RegEnumKey(hKey, i, astr.value, 256) = ERROR_SUCCESS
ListBox1.Items.Add(astr.value)
End While
RegCloseKey(hKey)
Else
ListBox1.Items.Add("There is some wrong") '此語句是用來說明沒有執行
End If
End Sub
End Class
出現的錯誤是: 未定义类型“VB6.fixedLengthString”。
請問這是怎麼回事.
在此先謝謝了!