Delphi Error: Undeclared identifier ‘TChilkatGlobal’

See the “Quick Start” instructions here:   https://www.chilkatsoft.com/delphiDll.asp The Chilkat distribution contains Delphi .pas source files, one for each Chilkat class. For each Chilkat class used, add the corresponding .pas file to your project. You’ll always need to add “Global.pas” because your app must always call UnlockBundle at the start. Also add “Global” to the “uses” section. See here:

Delphi Binary Data

This post shows some code snippets for getting data from Delphi Byte arrays (TBytes) and TMemoryStream’s in and out of Chilkat. First, here are some code snippets to convert from a TMemoryStream to a byte array, and back. Delphi TBytes to TMemoryStream

Convert CkDateTime to Delphi TDateTime

Question: Which is the best way to convert a CkDateTime to a Delphi TDateTime? Answer: I didn’t know the answer, so I Googled “Delphi TDateTime” to see exactly what it is.  It brought me to this web page:  http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/System_TDateTime.html In Delphi, TDateTime is a type that maps to a Double. In C++, the TDateTime class corresponds to the Delphi TDateTime […]

Delphi DLL TaskCompleted Callbacks

Also see: Delphi DLL AbortCheck Callbacks Delphi DLL PercentDone Callbacks Delphi DLL ProgressInfo Callbacks 1) First define a procedure exactly as shown here. Make sure to use the “cdecl” calling convention. 2) Set the task completed callback by calling the appropriate SetTaskCompleted function. For the CkRest object it is CkZip_SetTaskCompleted(rest,MyTaskCompleted); Note: This example shows TaskCompleted callbacks using CkRest. The same […]

Delphi DLL ProgressInfo Callbacks

Also see: Delphi DLL AbortCheck Callbacks Delphi DLL PercentDone Callbacks Delphi DLL TaskCompleted Callbacks 1) First define a procedure exactly as shown here. Make sure to use the “cdecl” calling convention. 2) Set the ProgressInfo callback by calling the appropriate SetProgressInfo function. For the CkSocket object it is CkSocket_SetProgressInfo(sock,MyProgressInfo); Note: This example shows ProgressInfo callbacks using CkSocket. The same technique […]

Delphi DLL AbortCheck Callbacks

Also see: Delphi DLL PercentDone Callbacks Delphi DLL ProgressInfo Callbacks Delphi DLL TaskCompleted Callbacks 1) First define a function exactly as shown here. Make sure to use the “cdecl” calling convention. Returning a non-zero Result will cause the Chilkat method to abort. 2) Set the abort check callback by calling the appropriate SetAbortCheck function. For the CkZip object it is […]

Delphi DLL PercentDone Callbacks

Also see: Delphi DLL AbortCheck Callbacks Delphi DLL ProgressInfo Callbacks Delphi DLL TaskCompleted Callbacks 1) First define a function exactly as shown here.  Make sure to use the “cdecl” calling convention. Returning a non-zero Result will cause the Chilkat method to abort.  It is important to set Result := 0 to allow the Chilkat method to continue. 2) Set the […]

Delphi DLL – GetBytesPtr (Writing PByte to TStream)

Chilkat v9.5.0.80 adds a new BinData function named GetBytesPtr.   It returns a pointer to the internal bytes contained within the BinData.   This post shows one way of writing those bytes to a Delphi TStream (using the Chilkat non-ActiveX Delphi DLL). procedure TForm1.Button2Click(Sender: TObject); var rawBytes: PByte; ItemCount: Integer; binDat: HCkBinData; Stream: TMemoryStream; Writer: TBinaryWriter; byteArr: TBytes; numBytes: Integer; i: Integer; […]

Chilkat 64-bit DLL for Delphi XE4 Now Available.

The 64-bit build of the Chilkat DLL for Delphi XE4 has been added to the v9.4.1 SP1 distribution. See http://www.chilkatsoft.com/delphiDll.asp The 32-bit DLL is named ChilkatDelphiXE.dll and is valid for Delphi XE2, XE3, and XE4  (and will likely be valid for future Delphi releases). The 64-bit DLL is named ChilkatDelphiXE4.dll and is valid for both Delphi XE3 and XE4. The […]