#include <WScom.h>
#include <WSCfunctionList.h>
#include <WSCbase.h>
//----------------------------------------------------------
//Function for the event procedure
//----------------------------------------------------------
#include <WSDmessage.h>
#include <WSCtextField.h>
extern WSCtextField* newtext_000;

void _msg_callback(char* buffer){
  WSCstring str;
  str.setString(buffer,WS_EN_UTF8);
  newtext_000->addString(str);  
  long lines = newtext_000->getLines();
  newtext_000->setBottomLine(lines);

//printf("tracer: getmessage:#%s#\n",buffer);
}
WSDmessage* _msg = NULL;
void initop(WSCbase* object){
  //do something...
  if (_msg == NULL){
    _msg = WSDmessage::getNewInstance();
    _msg->setupMessage("WS-TRACER",_msg_callback);
  }
}
static WSCfunctionRegister  op("initop",(void*)initop);
