Callbacks
Posted: Fri Aug 07, 2009 11:44 am
by The_Swami >> Fri, 5 Nov 1999 4:01:00 GMT
Hello,
I have been trying to do the callback thing using the API from an application wriiten in Pascal.
I don't want to write a DLL in C++ as I don't want the client to have to deploy DLL's along with the Exe (that starts to get messy), a single exe is the preferred option.
I have managed to reconstruct the function pointer for the DataHandlerCB as well as the DynamicDataHandlerStructure using records in Pascal.
I have managed also to do almost everything I need to do (incremental text searching retriving objects, running methods etc, etc). The only hurdle left is retrieving a string attribute that is of Maximum length (same problem occurs when running a method that returns a string).
In the header file jomstr.h there are two versions of an inline function called JADE_DEREF_STRING like so:
inline int
JADE_DEREF_STRING( const DynamicDataHandler *pDynaHandler, Character*& pData )
{
return pDynaHandler->callBack( JADE_DEREF_STRING_OP, pDynaHandler->pParam, (void**) &pData, 0 );
}
inline int
JADE_DEREF_STRING(DskParam* pParam, Character*& pData)
{
return pParam->body.dataHandler.callBack(JADE_DEREF_STRING_OP, pParam, (void**) &pData, 0);
}
Most of the paramGetString methods seem to be using the first version of this, which takes the dataHandler and not the DskParam, when dealing
with Jade Strings.
The question I have is regarding pDynaHandle->pParam fed into the callback method. I have treated this pParam is a pointer, in this case to a DskParam.
Is this DskParam set up for me by the param createJadeString API call I get out of jomutil.dll or do I have to set it up myself?
If I have to set it up myself what do I put in the header and the body
of it?
Any help would be greatly appreciated.
The Swami.
Hello,
I have been trying to do the callback thing using the API from an application wriiten in Pascal.
I don't want to write a DLL in C++ as I don't want the client to have to deploy DLL's along with the Exe (that starts to get messy), a single exe is the preferred option.
I have managed to reconstruct the function pointer for the DataHandlerCB as well as the DynamicDataHandlerStructure using records in Pascal.
I have managed also to do almost everything I need to do (incremental text searching retriving objects, running methods etc, etc). The only hurdle left is retrieving a string attribute that is of Maximum length (same problem occurs when running a method that returns a string).
In the header file jomstr.h there are two versions of an inline function called JADE_DEREF_STRING like so:
inline int
JADE_DEREF_STRING( const DynamicDataHandler *pDynaHandler, Character*& pData )
{
return pDynaHandler->callBack( JADE_DEREF_STRING_OP, pDynaHandler->pParam, (void**) &pData, 0 );
}
inline int
JADE_DEREF_STRING(DskParam* pParam, Character*& pData)
{
return pParam->body.dataHandler.callBack(JADE_DEREF_STRING_OP, pParam, (void**) &pData, 0);
}
Most of the paramGetString methods seem to be using the first version of this, which takes the dataHandler and not the DskParam, when dealing
with Jade Strings.
The question I have is regarding pDynaHandle->pParam fed into the callback method. I have treated this pParam is a pointer, in this case to a DskParam.
Is this DskParam set up for me by the param createJadeString API call I get out of jomutil.dll or do I have to set it up myself?
If I have to set it up myself what do I put in the header and the body
of it?
Any help would be greatly appreciated.
The Swami.