主题:请教VB代码转换成VFP代码?
Public Function GetProgID(ByVal sFileName As String) As Variant
Dim TLibInfo As TypeLibInfo
Dim TLibClass As CoClasses
Dim sResult() As String
Dim sHeader As String
Dim i As Integer
On Error GoTo ErrorMark
'Initialize
GetProgID = ""
sHeader = ""
Set TLibInfo = TypeLibInfoFromFile(Trim(sFileName))
Set TLibClass = TLibInfo.CoClasses
'ProgID Header
sHeader = TLibInfo.Name
If TLibClass.Count > 0 Then
ReDim sResult(TLibClass.Count - 1)
For i = 1 To TLibClass.Count
sResult(i - 1) = sHeader + "." + TLibClass.Item(i).Name
Next i
GetProgID = sResult
End If
ErrorMark:
Set TLibInfo = Nothing
Set TLibClass = Nothing
End Function
Public Function CheckFormat(ByVal sFileName As String) As Boolean
Dim TLibInfo As TypeLibInfo
Dim TLibClass As CoClasses
On Error GoTo ErrorMark
CheckFormat = False
Set TLibInfo = TypeLibInfoFromFile(Trim(sFileName))
Set TLibClass = TLibInfo.CoClasses
If Trim(TLibInfo.Name) <> "" And TLibClass.Count > 0 Then
CheckFormat = True
End If
ErrorMark:
Set TLibInfo = Nothing
Set TLibClass = Nothing
End Function
请即懂VFP又懂VB的老师帮助一下,把以上代码转换成VFP代码行不?