示例#1
0
//
// Write a string to the Error Log File, be sure its open before using
//
void plExportLogErrorMsg::IWriteErrorFile(const char* label, const char* msg)
{
    //make sure that there is a filename 
    if (fErrfile_name[0] != '\0')
    {
        // do we have it open, yet?
        if ( !fErrfile )
        {
            // must be the first write... open the error file
            fErrfile = hsFopen(fErrfile_name, "wt");
            setbuf(fErrfile, nil);
            fNumberErrors = 0;
        }
        fprintf(fErrfile, "%s: %s\n", label, msg);
        fNumberErrors++;    // oh, boy... another error to count
    }

   // Check to see if we are running an export server
   // If so, then pass the update on to the export server
   GUP* exportServerGup = OpenGupPlugIn(Class_ID(470000004,99));
   if(exportServerGup)
   {
      exportServerGup->Control(-5);  // means next control will be error msg
      char buf[1024];
      sprintf(buf, "%s: %s", label, msg);
      exportServerGup->Control((DWORD)buf);
      exportServerGup->Control(-7); // signal that we're done sending this update sequence
   }   
}
示例#2
0
void plExportProgressBar::Start(char *name, uint32_t steps)
{
    fTotalSteps = steps;
    fCurStep = 0;

    fInterface->ProgressEnd();
    fInterface->ProgressStart(name, TRUE, ProgressDummyFunc, nil);
   
   GUP* exportServerGup = OpenGupPlugIn(Class_ID(470000004,99));
   if(exportServerGup && name)
   {
      exportServerGup->Control(-3); // means next control will be progress task
      exportServerGup->Control((DWORD)name);
   }   
}
示例#3
0
bool plExportProgressBar::Update(char *name, uint32_t inc)
{
    fCurStep += inc;

   // Check to see if we are running an export server
   // If so, then pass the update on to the export server
   GUP* exportServerGup = OpenGupPlugIn(Class_ID(470000004,99));
   if(exportServerGup)
   {
      exportServerGup->Control(-2);  // means next control will be progress pct
      exportServerGup->Control((int)((fCurStep * 100) / fTotalSteps));  // send pct
      if(name)
      {
         exportServerGup->Control(-4); // means next control will be progress subtask
         exportServerGup->Control((DWORD)name);
      }
      exportServerGup->Control(-6); // signal that we're done sending this update sequence
   }   
   
   fInterface->ProgressUpdate((int)((fCurStep * 100) / fTotalSteps), FALSE, name);

    if (fInterface->GetCancel()) 
    {
        int retval = MessageBox(fInterface->GetMAXHWnd(), _T("Really Cancel?"),
            _T("Question"), MB_ICONQUESTION | MB_YESNO);
        if (retval == IDYES)
        {
            return true;
        }
        else if (retval == IDNO)
        {
            fInterface->SetCancel(FALSE);
        }
    }

    return false;
}