#include <WScom.h>
#include <WSCfunctionList.h>
#include <WSCbase.h>
//----------------------------------------------------------
//Function for the event procedure
//----------------------------------------------------------
#include <newwin000.h>
#include <WSCmessageDialog.h>

void msgread(WSCbase* object){
  char buffer[1024];
  newvsso_000->read((WSCuchar*)buffer,1024);
  WSCstring from_addr = newvsso_000->getDestAddr();
  WSCstring message;
  message << "receive from: " << from_addr << "\n" << buffer;
  
  WSGIappMessageDialog()->setProperty(WSNlabelString,message);  
  WSGIappMessageDialog()->setProperty(WSNwidth,600);
  WSGIappMessageDialog()->setProperty(WSNheight,200);
  WSGIappMessageDialog()->setProperty(WSNdefaultPosition,True);
  WSGIappMessageDialog()->popup();
}
static WSCfunctionRegister  op("msgread",(void*)msgread);
