Livecode Builder - passing lcs string to C functions

Trevor DeVore lists at
Mon Dec 28 17:07:49 EST 2020

On Mon, Dec 28, 2020 at 7:02 AM Dan Brown via use-livecode <
use-livecode at> wrote:

> Hi I'm stuck trying to find examples of passing lcs strings to a C function
> via pointer and it's driving me mad! I can retrieve char * pointers from C
> functions, convert to string and pass back to lcs but haven't come across
> any easy to grok examples of sending data to C. Any guidance would be
> appreciated

I've used MCStringConvertToBytes to convert strings to a value you can pass
in as const char*. I have a hunspell example you can reference.

Here is a link to the Hunspell_spell definition:

LIBHUNSPELL_DLL_EXPORTED int Hunspell_spell(Hunhandle* pHunspell, const

Here is a link to the LCB code that passes a UTF8 string to Hunspell_spell:

Here is a link to the MCStringConvertToBytes definition in the LCB file:

Trevor DeVore

More information about the use-livecode mailing list