|
-
September 23rd, 2005, 02:43 PM
#3
Re: Run-time Error 52 Bad filename or number
The actuall dll code is rather long, but the calling routine is as follows
Private Declare Sub ParseBDF Lib _
"C:\MyDllLibrary\BDF Parser\BDFParserDLL.dll" _
(ByVal FName As String) ', ByRef Gctr As Integer)
Sub Main()
Dim FName As String
If Command$ <> "" Then
FName = Command$
Else
With Form1.CD1
.FileName = ""
.CancelError = True
.DialogTitle = "Select BDF File"
.Filter = "Bulk Data File (*.bdf)|*.bdf|All Files (*.*)|*.*"
.Flags = cdlOFNFileMustExist Or cdlOFNExplorer Or cdlOFNLongNames
.ShowOpen
FName = .FileName
End With
End If
MsgBox (FName)
ParseBDF FName ', Gctr)
Stop
End Sub
The dll starts as follows
Sub ParseBDF(ByVal FName As String) ', ByRef Gctr As Integer)
Dim FNum As Integer: FNum = FreeFile
Dim TStr As String
Dim tmpstr As String
Dim tmplen1 As Integer
Dim tmplen2 As Integer
Dim comlen1 As Integer
Dim comlen2 As Integer
Dim FileType As String * 3
Dim LineType As String
Erase Grid
Gctr = 0: Pctr = 0: Mctr = 0
Close FNum
Open FName For Input As FNum
Line Input #FNum, TStr
...
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|