---
product: Chilkat
product_version: 11.7.0
language: delphidll
language_label: Delphi DLL
document: language guide
---
> Chilkat 11.7.0 · language=delphidll · this file: `https://www.chilkatsoft.com/ai-docs/v/11.7.0/delphidll/guide.md`
> Class pages: `https://www.chilkatsoft.com/ai-docs/v/11.7.0/delphidll/classes/<Class>.md`

# Chilkat for Delphi DLL — language guide — v11.7.0

## 1. Which Chilkat binding this is

This is the **Chilkat Delphi DLL** binding: a native, non-COM API for RAD Studio (Delphi XE through Delphi 13; also Delphi 7–2010 on Windows; Linux, macOS, iOS and Android through the same units). Objects are handles created with `CkHttp_Create()` and released with `CkHttp_Dispose(h)`; methods are functions `CkHttp_QuickGetStr(h, url, outStr)` with lowercase-initial string forms (`CkHttp__quickGetStr`) returning `PWideChar`; properties through `CkHttp_getPort(h)` / `CkHttp_putPort(h, 443)`. Not the **Delphi ActiveX** binding (`delphix/`, the COM type library imported into Delphi).

## 2. Install and requirements

Download from [https://www.chilkatsoft.com/delphidll.asp](https://www.chilkatsoft.com/delphidll.asp): add the units to the project and put `ChilkatDelphi.dll` (Windows) or the platform library where the application can load it.

## 3. Unlocking, object creation, lifetime and errors

Generated from the reference documentation for this binding:

**Create/Dispose**

```pascal
var
myObject: HCkGlobal;

begin
myObject := CkGlobal_Create();

// ...

CkGlobal_Dispose(myObject);
end;
```

`function CkGlobal_Create: HCkGlobal; stdcall;`

Creates an instance of the HCkGlobal object and returns a handle (i.e. a Pointer). The handle is passed in the 1st argument for the functions listed on this page.

`procedure CkGlobal_Dispose(handle: HCkGlobal); stdcall;`

Objects created by calling CkGlobal_Create must be freed by calling this method. A memory leak occurs if a handle is not disposed by calling this function.

## 4. Error model

Functions **do not raise exceptions**. The note under each function on the class page says how it reports failure: a `Boolean` status function returns `False`; the lowercase-initial string form returns `nil` on failure, and the returned `PWideChar` is owned by the object and valid only until the next call on that handle (copy it into a `string` immediately — see [https://www.chilkatsoft.com/delphi_pwidechar.asp](https://www.chilkatsoft.com/delphi_pwidechar.asp)); the uppercase form fills an `HCkString` and returns `Boolean`; object-returning functions return `0`/`nil` and the handle must be disposed by the caller; for an `Integer` result check `CkHttp_getLastMethodSuccess(h)`. `CkHttp__lastErrorText(h)` holds the diagnostic in every case.

Literals in Delphi DLL: true is `True`, false is `False`, null/none is `nil`.

## 5. Strings, bytes and encodings

- Strings are `PWideChar` (UTF-16) in and out; copy results into a Delphi `string` at once. A `charset` argument names the encoding of the *bytes* being produced or read.
- Binary data goes through `HCkByteData` / `HCkBinData` handles (`Bd` functions); `TMemoryStream` interop: [https://www.chilkatsoft.com/delphi_tmemorystream_to_from_bindata.asp](https://www.chilkatsoft.com/delphi_tmemorystream_to_from_bindata.asp).
- Functions with `2`/`3` suffixes or `Quick*` prefixes are distinct functions, not overloads.

## 6. Object lifetime and threading

Every handle created with `Ck*_Create` or returned by a function must be released with the matching `Ck*_Dispose`.

A Chilkat object may be used from any thread, but **one object must not be used by two threads at the same time**: create one object per thread or protect it with a lock. Objects are independent — there is no shared global state other than the unlock flag and the few `Global` settings.

## 7. Progress callbacks and async

Progress events are supported: see the "Events and callbacks" section of a class page for the event list and how to attach a handler in this binding (AbortCheck, PercentDone, ProgressInfo and TaskCompleted are the standard ones). Every method with an "Async variant" line also has an `XAsync` twin that returns a `Task` immediately; poll `Finished` or use the `TaskCompleted` event, then read the result from the task. No new Async methods are added from 11.7.0 on. In Delphi, events are callback procedures set through `CkHttp_setAbortCheck(h, @proc)` etc. — see [https://www.chilkatsoft.com/delphi_event_callbacks.asp](https://www.chilkatsoft.com/delphi_event_callbacks.asp).

## 8. Common mistakes an AI makes with this binding

1. Writing Delphi ActiveX code (`TChilkatHttp`, `CreateOleObject('Chilkat.Http')`) against the DLL binding, or the reverse.
2. Keeping a `PWideChar` result across another call on the same handle.
3. Forgetting `Ck*_Dispose` on created or returned handles.
4. Omitting `Global.UnlockBundle` (the program runs in trial mode and stops working after 30 days).
5. Inventing members by analogy with other libraries. If a member is not on the class page, it does not exist — look it up rather than guessing.
6. Using deprecated members that older examples still show. The class page lists each one with its replacement; `deprecated.md` lists them all.
7. Ignoring the failure path. Every Chilkat method reports failure (see each method's note); `LastErrorText` says why, and printing it is the first debugging step.
8. Using one Chilkat object from two threads at the same time. Create one object per thread, or protect it with a lock.

## 9. Instructions block for coding agents

Paste into `CLAUDE.md`, `.cursor/rules`, or Copilot instructions:

```
This project uses Chilkat 11.7.0 from Delphi (DLL binding) (the non-COM Delphi DLL API: CkHttp_Create/CkHttp_Dispose handles and CkHttp_* functions).
- Reference: https://www.chilkatsoft.com/ai-docs/v/11.7.0/delphidll/ — read guide.md once, then classes/<Class>.md for each class used.
- Create an HCkGlobal with CkGlobal_Create() and call CkGlobal_UnlockBundle(h, ...) once at startup; dispose every handle.
- Functions never raise: lowercase string functions return nil on failure, Boolean status functions return False; copy PWideChar results immediately; print CkXxx__lastErrorText(h) on failure.
- Never use a member that is not on the class page; never use members listed as deprecated.
```

## 10. Classes

[Class index for Delphi DLL](https://www.chilkatsoft.com/ai-docs/v/11.7.0/delphidll/index.md)
