Passing Data to the Callback Routine

The value of the nMsg parameter determines the different functions. The values are the constants which begin with LL_CMND_xxxx, e.g. LL_CMND_TABLEFIELD, LL_NTFY_xxxx or LL_INFO.

Depending on the task your program has to perform, the parameter lParam has different meanings. The individual meanings are described later on. They are mostly structures (records) which lParam points to, so the value must therefore be cast by a type conversion to a structure pointer:

LRESULT CALLBACK _extern
       LLCallback(INT wParam, LPARAM lParam, UINT_PTR lUserParam)      
{
       PSCLLTABLEFIELD pSCF;

       switch (wParam)
       {
                case LL_CMND_TABLEFIELD:
                        pSCF = (PSCLLTABLEFIELD)lParam;
                        // do something using pSCF;
                        break;
       }
       return(0);
}

The function must always return a defined value. Unless stated otherwise, this value should be zero.

lUserParam is the value passed by

LlSetOption(hJob, LL_OPTION_CALLBACKPARAMETER, <Value>)

This can be used to store an object pointer ("this", "self") in object-oriented languages.