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

# Chilkat for PowerBuilder — language guide — v11.7.0

> This guide has only generated sections so far. The class pages carry the per-member detail.

## Object creation, unlocking and error handling

**Object Creation**

```powerbuilder
oleobject loo_Global
integer li_rc

loo_Global = create oleobject
li_rc = loo_Global.ConnectToNewObject("Chilkat.Global")
if li_rc < 0 then
    destroy loo_Global
    MessageBox("Error","Connecting to COM object failed")
    return
end if

// ... use loo_Global ...

destroy loo_Global
```

PowerBuilder uses the Chilkat ActiveX through an `oleobject`: declare the variable, `create` it, connect it to the Chilkat class with `ConnectToNewObject`, and `destroy` it when finished. A negative return code from `ConnectToNewObject` means the ActiveX is not registered, or the registered ActiveX does not match the bitness (32-bit or 64-bit) of the PowerBuilder target.

Objects returned by methods (such as an `HttpResponse` or `JsonObject`) are also `oleobject` variables and must likewise be destroyed. A method that fails to return an object returns `null`; test with `IsNull()`. In the signatures on this page, the Chilkat class name identifies which object is expected or returned; the PowerBuilder variable type is always `oleobject`.

To bind to a specific major version of Chilkat, append the major version number to the ProgID, such as `ConnectToNewObject("Chilkat.Global.11")` for Chilkat v11.\*.\*.

Members typed `blob` exchange binary data as a Variant byte array. The PowerBuilder examples instead use the `BinData`-based alternatives (methods ending in *Bd*), which keep binary data inside Chilkat objects.

Literals in PowerBuilder: true is `1`, false is `0`, null/none is `null`.

## Classes

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