Sample code for 30+ languages & platforms
Visual Basic 6.0

Load Entire File into BinData

Demonstrates how to load an entire file into a BinData object.

Chilkat Visual Basic 6.0 Downloads

Visual Basic 6.0
Dim success As Long
success = 0

Dim fac As New CkFileAccess

success = fac.OpenForRead("qa_data/pdf/sample.pdf")
If (success = 0) Then
    Debug.Print fac.LastErrorText
    Exit Sub
End If

Dim bd As New ChilkatBinData
Dim maxBytesToRead As Long
maxBytesToRead = 99999999
success = fac.FileReadBd(maxBytesToRead,bd)
If (success = 0) Then
    Debug.Print fac.LastErrorText
    Exit Sub
End If

fac.FileClose 

' The bd object contains the file data...
success = bd.WriteFile("qa_output/sample.pdf")