login about faq

the decryptStringENC method for the CkCrypt2 class shows that a bool is returned with the decrypted string being returned as the 2nd parameter. The C++ example shows the method being used with one parameter and the decrypted string being returned as the result of the method. Which one is correct?

Also, can a CkString be cast to a C++ "string" type successfully?

asked Jan 03 '13 at 13:33

dwm2012's gravatar image


Each Chilkat C++ method that returns a string has two versions — an upper-case version that returns the string in a CkString (always the last argument), and a lower-case version that returns a "const char *".

For example, in the CkEmail class:

bool GetHeaderField(const char *fieldName, CkString &outFieldValue);
const char *getHeaderField(const char *fieldName);
The lower-case method returning a "const char *" returns a pointer to memory that may be overwritten in subsequent calls. Therefore, make sure to copy the string to a safe place immediately before making additional calls on the same Chilkat object instance. (Only methods that also return "const char *" would overwrite the memory from a previous call.)

The upper-case version of the method returns the string in a CkString object. It is an output-only argument, meaning that the CkString contents are replaced, not appended.


answered Jan 03 '13 at 17:33

chilkat's gravatar image

chilkat ♦♦

edited Jan 03 '13 at 17:34

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: Jan 03 '13 at 13:33

Seen: 2,202 times

Last updated: Jan 03 '13 at 17:34

powered by OSQA