login about faq

When I use ck dll functions returning HCkString (like ckSTR := CkImap__selectedMailbox(Imap) ) How should I convert it to normal string ? (OleStrToString ?) Do I need to free ckSTR at end ? , is it memoryleak safe ?

asked Nov 01 '14 at 06:54

nir's gravatar image


Each Delphi DLL method or property that returns a string has two forms. The upper-case form returns the string in an output-only HCkString in the last argument. The lower-case form returns the string directly as a System.PWideChar. The lowercase form uses a double-underscore and for properties, omits the "get".

For example:

procedure CkImap_getSelectedMailbox(objHandle: HCkImap; outPropVal: HCkString); stdcall;

function CkImap__selectedMailbox(objHandle: HCkImap): PWideChar; stdcall;

If the uppercase form is used, the HCkString object must first be instantiated by the app, and afterwards disposed (just like any Chilkat object).


answered Nov 04 '14 at 13:17

chilkat's gravatar image

chilkat ♦♦

and for the lowercase ? , is the attached command is the right way ?


(Nov 05 '14 at 01:41) nir
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Nov 01 '14 at 06:54

Seen: 2,192 times

Last updated: Nov 05 '14 at 01:41

powered by OSQA