Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(DataFlex) Load Entire File into BinDataDemonstrates how to load an entire file into a BinData object.
Use ChilkatAx-win32.pkg Procedure Test Handle hoFac Boolean iSuccess Variant vBd Handle hoBd Integer iMaxBytesToRead String sTemp1 Get Create (RefClass(cComCkFileAccess)) To hoFac If (Not(IsComObjectCreated(hoFac))) Begin Send CreateComObject of hoFac End Get ComOpenForRead Of hoFac "qa_data/pdf/sample.pdf" To iSuccess If (iSuccess = False) Begin Get ComLastErrorText Of hoFac To sTemp1 Showln sTemp1 Procedure_Return End Get Create (RefClass(cComChilkatBinData)) To hoBd If (Not(IsComObjectCreated(hoBd))) Begin Send CreateComObject of hoBd End Move 99999999 To iMaxBytesToRead Get pvComObject of hoBd to vBd Get ComFileReadBd Of hoFac iMaxBytesToRead vBd To iSuccess If (iSuccess = False) Begin Get ComLastErrorText Of hoFac To sTemp1 Showln sTemp1 Procedure_Return End Send ComFileClose To hoFac // The bd object contains the file data... Get ComWriteFile Of hoBd "qa_output/sample.pdf" To iSuccess End_Procedure |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.