![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(DataFlex) Transition from Zip.AppendBd to Zip.AddBdProvides instructions for replacing deprecated AppendBd method calls with AddBd. Note: This example requires Chilkat v11.0.0 or greater.
Use ChilkatAx-win32.pkg Procedure Test Handle hoZip String sPathInZip Variant vBd Handle hoBd Boolean iSuccess Variant vEntryObj Handle hoEntryObj Boolean iSuccess Variant vZe Handle hoZe Integer iIndex String sTemp1 Integer iTemp1 Boolean bTemp1 Get Create (RefClass(cComChilkatZip)) To hoZip If (Not(IsComObjectCreated(hoZip))) Begin Send CreateComObject of hoZip End // ... // ... Move "example.dat" To sPathInZip Get Create (RefClass(cComChilkatBinData)) To hoBd If (Not(IsComObjectCreated(hoBd))) Begin Send CreateComObject of hoBd End Get ComLoadFile Of hoBd "c:/someDir/example.dat" To iSuccess // ------------------------------------------------------------------------ // The AppendBd method is deprecated: // AppendBd returns the zip entry object, which is usually not needed. Get pvComObject of hoBd to vBd Get ComAppendBd Of hoZip sPathInZip vBd To vEntryObj If (IsComObject(vEntryObj)) Begin Get Create (RefClass(cComChilkatZipEntry)) To hoEntryObj Set pvComObject Of hoEntryObj To vEntryObj End Get ComLastMethodSuccess Of hoZip To bTemp1 If (bTemp1 = False) Begin Get ComLastErrorText Of hoZip To sTemp1 Showln sTemp1 Procedure_Return End // ... // ... Send Destroy of hoEntryObj // ------------------------------------------------------------------------ // Do the equivalent using AddBd. // Instead of returning the zip entry object, we just return success/failure. Get pvComObject of hoBd to vBd Get ComAddBd Of hoZip sPathInZip vBd To iSuccess If (iSuccess = False) Begin Get ComLastErrorText Of hoZip To sTemp1 Showln sTemp1 Procedure_Return End // Do the following if you need the zip entry object for what was just appended. // The newly appended entry is the last one. Get Create (RefClass(cComChilkatZipEntry)) To hoZe If (Not(IsComObjectCreated(hoZe))) Begin Send CreateComObject of hoZe End Get ComNumEntries Of hoZip To iTemp1 Move (iTemp1 - 1) To iIndex Get pvComObject of hoZe to vZe Get ComEntryAt Of hoZip iIndex vZe To iSuccess End_Procedure |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.