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

void sendop(WSCbase* object){
  long pos = newlist_001->getSelectedPos();
  if (pos <0){
    return;
  }
  WSCstring addr = newlist_001->getSelectedItem();
  newvcso_000->setProperty(WSNip,(char*)addr);
  long ret = newvcso_000->exec();
  if (ret != WS_NO_ERR){
    WSGIappMessageDialog()->setProperty(WSNlabelString,"connect failed..");
    WSGIappMessageDialog()->setProperty(WSNwidth,400);
    WSGIappMessageDialog()->setProperty(WSNheight,120);
    WSGIappMessageDialog()->setProperty(WSNdefaultPosition,True);
    WSGIappMessageDialog()->popup();
  }
}
static WSCfunctionRegister  op("sendop",(void*)sendop);
