MessageData Class Referenceabstract

#include <c4d_messagedata.h>

Inheritance diagram for MessageData:

Detailed Description

A data class for creating message plugins.
Use RegisterMessagePlugin() to register a message plugin.

Here is an example of a message plugin, which CoreMessage() method is called each 100 ms:

#include "c4d.h"
#include "c4d_symbols.h"
class TimerMessage : public MessageData
{
virtual Int32 GetTimer(void);
virtual Bool CoreMessage(Int32 id, const BaseContainer &bc);
};
Int32 TimerMessage::GetTimer()
{
return 100;
}
Bool TimerMessage::CoreMessage(Int32 id, const BaseContainer &bc)
{
if (id==MSG_TIMER)
{
// Do something
}
return true;
}
Bool RegisterTimerMessage(void)
{
return RegisterMessagePlugin(1234567, String(), 0, NewObj(TimerMessage));
}

Public Member Functions

virtual Int32 GetTimer (void)
 
virtual Bool CoreMessage (Int32 id, const BaseContainer &bc)=0
 
- Public Member Functions inherited from BaseData
 BaseData ()
 
virtual ~BaseData (void)
 
void Destructor (void)
 

Member Function Documentation

§ GetTimer()

virtual Int32 GetTimer ( void  )
virtual

Called to return a time in milliseconds to receive timer messages (MSG_TIMER) with that interval in CoreMessage().
This method is queried again after each message.

Returns
The timer interval in milliseconds, or 0 for no timer messages.

§ CoreMessage()

virtual Bool CoreMessage ( Int32  id,
const BaseContainer bc 
)
pure virtual

Called to receive core messages.

See also
The article Core Messages for more information.
Parameters
[in]idThe core message ID: EVMSG
[in]bcThe core message container.
Returns
Currently not used.