long KCssAPI KCssCall( /* call function */
KCssHandle aHandle, /* CSS handle */
const char *aFileName, /* file/module caller belongs to */
const char *aFuncName, /* function name */
long aArgCount, /* # of arguments following */
char *aParam[] /* parameter list. NULL if no args */
);
Calls any CSS, C or C++ function known to CSS. Parameters are passed as a list of ASCIZ strings. Example: // call strSubString
static char *args[] = { "The quick brow fox", "5", "10" };
long errs;
errs = KCssCall(css, "MyProg.exe", "strSubString", sizeof(args)/sizeof(char*), args);
if (errs) .... // error handling
// get size of return value first for buffer allocation:
long size;
errs = KCssGetResult(css, NULL, &size);
if (errs) .... // error handling
// now allocate buffer and retrieve value
char* buf = new char[size];
errs = KCssGetResult(css, buf, &size);
if (errs) .... // error handling
...
// when value no longer needed, dont forget to release buffer
delete [] buf;
|