There are many ways indeed to acomplish what you want to do. A COM object written in C++, would indeed be a very good way to do it. All you then need to do is to refernce the dll from your VB project and code away.
Other than that, i would have said the Input function, and the Get function. I usually find that the Get function is quicker on smaller files, while the Input function is quicker on larger files.
Code:Private Sub inputMethod(strFile As String) Dim strText As String Open strFile For Input As #1 'get the whole file. strText = Input(LOF(1), #1) Close #1 End Sub Private Sub getMethod(strFile As String) Dim bTemp As String Dim strText As String Open strFile For Binary As #1 'redim the byte array to the size of the file ReDim bTemp(LOF(1) - 1) As Byte 'get the file in binary Get #1, , bTemp Close #1 'convert the byte array to a string strText = StrConv(bTemp, vbUnicode) End Sub




Reply With Quote