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

nir
137


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).

link

answered Nov 04 '14 at 13:17

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

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

myFolder:=WideCharToString(CkImap__selectedMailbox(Imap));

(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

By RSS:

Answers

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

Tags:

×5

Asked: Nov 01 '14 at 06:54

Seen: 1,040 times

Last updated: Nov 05 '14 at 01:41

powered by OSQA