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

void btnop(WSCbase* object){
  //do something...
  WSCRbase* inst = WSGIappObjectList()->getRemoteInstance("instance1");
  if (inst == NULL){
    WSGIappMessageDialog()->setProperty(WSNwidth,600);
    WSGIappMessageDialog()->setProperty(WSNlabelString,
        "RemoteInstance: instance1 not found.\nwsagent or remote server may not be running..");
    WSGIappMessageDialog()->popup();
    return;
  }
  static long cnt=1;
  WSCstring str;
  str << "remote call:" << cnt;
  inst->setProperty(WSNforeColor,"#ff0000");
  inst->setProperty(WSNlabelString,str);
  cnt++;
}
static WSCfunctionRegister  op("btnop",(void*)btnop);
