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

void tstopop(WSCbase* object){
  WSCdialog* dialog = (WSCdialog*)object->cast("WSCdialog");
  if (dialog == NULL){
    return;
  }
  if (dialog->getStatus() == WS_DIALOG_OK){
extern WSCstring get_pure_project_name();
    WSCstring str = get_pure_project_name();
//printf("start trace:%s\n",(char*)str);
    WSDmessage::sendMessageEx(NULL,(char*)str,"1");
    dialog->setProperty(WSNok,False);
    dialog->setProperty(WSNno,True);
    dialog->update();
    return;
  }
  WSCstring str;
extern WSCstring get_pure_project_name();
  str = get_pure_project_name();
  if (!strcmp("",(char*)str)){
    return;
  }
  WSDmessage::extSendMessage(NULL,(char*)str,"0");
  dialog->setProperty(WSNno,False);
  dialog->setProperty(WSNok,True);
  dialog->update();
//printf("stop... %s\n",(char*)str);
}
static WSCfunctionRegister  op("tstopop",(void*)tstopop);
