提示
compile err:
can't assign array
将ini API中的lpbuffer参数换成temp 就解决了
为何???
Public Function funcThisProgramProfileRead(ByVal lpSectionName As String) As String()
   On Error GoTo PROC_ERR
   Dim PCount As Integer
   Dim lpProfileName As String
   Dim sys(1) As String * 255
   Dim pro() As String
   Dim maxcount As Variant
   lpProfileName = App.Path & "\program.ini"
   PCount = GetPrivateProfileInt(lpSectionName, "PropertiesCount", 26, lpProfileName)
   ReDim pro(PCount)
   If lpSectionName = "system" Then
       maxcount = GetPrivateProfileInt(lpSectionName, "bMaxCount", 500, lpProfileName)
       sys(0) = maxcount
       GetPrivateProfileString lpSectionName, "iniFileName", "config.ini", sys(1) , 10, lpProfileName
     '  sys(1) = temp
       funcThisProgramProfileRead = sys()
   ElseIf lpSectionName = "properties" Then
       For i = LBound(pro) To UBound(pro)
          GetPrivateProfileString lpSectionName, CStr(i), "", pro(i) , 100, lpProfileName
        '  pro(i) = temp
        Next
       funcThisProgramProfileRead = pro()
   End If
   Exit Function
PROC_ERR:
      MsgBox "Error: " & Err.Number & vbCrLf & Err.Description, , "错误"
      On Error GoTo 0
Resume NextEnd Function