• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ ErrorMessage函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ErrorMessage函数的典型用法代码示例。如果您正苦于以下问题:C++ ErrorMessage函数的具体用法?C++ ErrorMessage怎么用?C++ ErrorMessage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ErrorMessage函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: cmd_move


//.........这里部分代码省略.........
        freep(arg);
        return 1;
    }

    /* If no destination is given, default to current directory */
    pszDest = (nFiles == 1) ? _T(".") : arg[i + 1];

    /* check for wildcards in source and destination */
    if (_tcschr(pszDest, _T('*')) != NULL || _tcschr(pszDest, _T('?')) != NULL)
    {
        /* '*'/'?' in dest, this doesnt happen.  give folder name instead*/
        error_invalid_parameter_format(pszDest);
        freep(arg);
        return 1;
    }
    if (_tcschr(arg[i], _T('*')) != NULL || _tcschr(arg[i], _T('?')) != NULL)
    {
        dwMoveStatusFlags |= MOVE_SOURCE_HAS_WILD;
    }

    /* get destination */
    GetFullPathName (pszDest, MAX_PATH, szDestPath, NULL);
    TRACE ("Destination: %s\n", debugstr_aw(szDestPath));

    /* get source folder */
    GetFullPathName(arg[i], MAX_PATH, szSrcDirPath, &pszFile);
    if (pszFile != NULL)
        *pszFile = _T('\0');
    TRACE ("Source Folder: %s\n", debugstr_aw(szSrcDirPath));

    hFile = FindFirstFile (arg[i], &findBuffer);
    if (hFile == INVALID_HANDLE_VALUE)
    {
        ErrorMessage (GetLastError (), arg[i]);
        freep (arg);
        return 1;
    }

    /* check for special cases "." and ".." and if found skip them */
    FoundFile = TRUE;
    while(FoundFile &&
          (_tcscmp(findBuffer.cFileName,_T(".")) == 0 ||
           _tcscmp(findBuffer.cFileName,_T("..")) == 0))
        FoundFile = FindNextFile (hFile, &findBuffer);

    if (!FoundFile)
    {
        /* what? we don't have anything to move? */
        error_file_not_found();
        FindClose(hFile);
        freep(arg);
        return 1;
    }

    OnlyOneFile = TRUE;
    /* check if there can be found files as files have first priority */
    if (findBuffer.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
        dwMoveStatusFlags |= MOVE_SOURCE_IS_DIR;
    else
        dwMoveStatusFlags |= MOVE_SOURCE_IS_FILE;
    while(OnlyOneFile && FindNextFile(hFile,&findBuffer))
    {
        if (!(findBuffer.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
        {
            ConOutPrintf(_T(""));
            if (dwMoveStatusFlags & MOVE_SOURCE_IS_FILE) OnlyOneFile = FALSE;
开发者ID:AJMartel,项目名称:IRTriageCMD,代码行数:67,代码来源:move.c


示例2: openInputFileAndControl

void OpenSMOKE_CHEMKINInterpreter_ThermoData::ReadThermoData(const std::string file_name, ofstream *_fLog)
{
	const int SIZE = 400;
	char comment[SIZE];

	fLog = _fLog;

	ifstream fInput;
	openInputFileAndControl(fInput, file_name);

	// ---------------------------------------------------------------
	// Reading lines
	// ---------------------------------------------------------------
	lines.push_back("List of lines");

	while(!fInput.eof())
	{
		fInput.getline(comment, SIZE);
		lines.push_back(comment);
	}
	fInput.close();

	number_of_lines = lines.size()-1;

	// ---------------------------------------------------------------
	// Parsing lines
	// ---------------------------------------------------------------
	int i;
	for(i=1;i<=number_of_lines;i++)
	{
		if (CheckForBlankLine(lines[i]) == true)		indexBlankLines.Append(i);
		else if (CheckForCommentLine(lines[i]) == true)	indexCommentLines.Append(i);
		else if (CheckForEndLine(lines[i]) == true)		indexCommentLines.Append(i);		
		else											indexLines.Append(i);
	}

	int count_additional=0;
	for(i=1;i<=indexLines.Size();i++)
		count_additional += StringFind(lines[indexLines[i]], "1&");
	total_number_of_species = (indexLines.Size()-count_additional)/4;

	*fLog << " ----------------------------------------------------------------" << endl;
	*fLog << "                     Thermodynamic Database                      " << endl;
	*fLog << " ----------------------------------------------------------------" << endl;
	*fLog << "    Total number of full lines:    " << indexLines.Size()			<< endl;
	*fLog << "    Total number of blank lines:   " << indexBlankLines.Size()		<< endl;
	*fLog << "    Total number of comment lines: " << indexCommentLines.Size()	<< endl;
	*fLog << "    Total number of lines:         " << number_of_lines			<< endl;
	*fLog << "    Total number of species:       " << total_number_of_species			<< endl;
	*fLog << " ----------------------------------------------------------------" << endl;

	species = new OpenSMOKE_CHEMKINInterpreter_ThermoSpecies[total_number_of_species+1];
	
	vector<string> instructions;
	
	// ---------------------------------------------------------------
	// First line
	// ---------------------------------------------------------------
	SeparateInstructions(lines[indexLines[1]], instructions);
	if (instructions.size()-1 > 2)		ErrorMessage("Too many arguments in the first line");
	if (instructions[1] != "THERMO")	ErrorMessage("Expected: THERMO - Found: " + instructions[1]);
	if (instructions.size()-1 == 2)
		if (instructions[2] != "ALL")	ErrorMessage("Expected: ALL - Found: " + instructions[2]);

	// ---------------------------------------------------------------
	// Second line
	// ---------------------------------------------------------------
	SeparateInstructions(lines[indexLines[2]], instructions);
	if (instructions.size()-1 != 3)		ErrorMessage("Too many arguments in the second line");
	tmin  = atof(instructions[1].c_str());
	tmean = atof(instructions[2].c_str());
	tmax  = atof(instructions[3].c_str());

	int j=3;
	for(i=1;i<=total_number_of_species;i++)
	{
		species[i].AssignTemperatures(tmin, tmean, tmax);
		species[i].ReadMainData(lines[indexLines[j]], indexLines[j]);	j++;
		if (species[i].iContinuation==true)
		{	
			species[i].ReadAdditionalLine(lines[indexLines[j]]);		j++;
		}
		species[i].ReadFirstLine(lines[indexLines[j]]);					j++;
		species[i].ReadSecondLine(lines[indexLines[j]]);				j++;
		species[i].ReadThirdLine(lines[indexLines[j]]);					j++;

		species[i].Analyze();
	}
}
开发者ID:acuoci,项目名称:OpenSMOKE,代码行数:89,代码来源:OpenSMOKE_CHEMKINInterpreter_ThermoData.cpp


示例3: ErrorMessage

	inline T OpenSMOKEVector<T, IndexPolicy>::GetValue(const int i) const
	{
		if( (i<IndexPolicy::index_) || (i>dimensions_-1+this->index_) )
			ErrorMessage("Vector index outside the ranges");
		return vector_[i];
	}
开发者ID:acuoci,项目名称:edcSMOKE,代码行数:6,代码来源:OpenSMOKEVector.hpp


示例4: switch

double UNITS::LinearFactor () {
    
    double factor = 1;
    
    /// First convert all to meters
    switch (in) {
        case ANG:
            factor = 1E-10;
            break;
        case NM:
            factor = 1E-09;
            break;
        case MUM:
            factor = 1E-06;
            break;
        case MM:
            factor = 1E-03;
            break;
        case CM:
            factor = 1E-02;
            break;
        case M:
            factor = 1;
            break;
        case KM:
            factor = 1E+03;
            break;
        case UA:
            factor = 1.49597870700E11;
            break;
        case PC:
            factor = 3.08567758E16;
            break;
        case KPC:
            factor = 3.08567758E19;
            break;
        case MPC:
            factor = 3.08567758E22;
            break;              
        default:
            ErrorMessage();
            return factor;
    }
    
    
    switch (out) {
        case ANG:
            factor *= 1E+10;
            break;
        case NM:
            factor *= 1E+09;
            break;
        case MUM:
            factor *= 1E+06;
            break;
        case MM:
            factor *= 1E+03;
            break;
        case CM:
            factor *= 1E+02;
            break;
        case M:
            factor *= 1;
            break;
        case KM:
            factor *= 1E-03;
            break;
        case UA:
            factor *= 6.68458712E-12;
            break;
        case PC:
            factor *= 3.24077929E-17;
            break;
        case KPC:
            factor *= 3.24077929E-20;
            break;
        case MPC:
            factor *= 3.24077929E-23;
            break;              
        default:
            ErrorMessage();
            factor=1;
            return factor;
    }
    
    return factor;
}
开发者ID:editeodoro,项目名称:Bbarolo,代码行数:87,代码来源:converter.cpp


示例5: SndFIO

SndAiff::SndAiff(char* name, short mode, short channels, short bits,
		 SndObj** inputlist, float spos, int vecsize, float sr):
  SndFIO(name, mode, channels, bits, inputlist, spos, vecsize, sr)
{
	
  m_selfdesc = 1; // yes, this is a self-describing  format !!!!
  m_isaiff = false;
  if(m_mode != READ){     // OUTPUT
    m_framesize = (short)((m_bits/8)*m_channels);
    m_header = PutHeader();
		
    if(m_mode != APPEND){
      fwrite((char *)&m_form, sizFormHdr, 1, m_file); 
      fwrite((char *)&m_comm1, sizCommChunk1, 1, m_file);
      fwrite((char *)&m_comm2, sizCommChunk2, 1, m_file);
      fwrite((char *)&m_ssnd, sizSoundDataHdr, 1, m_file);
      m_datapos = ftell(m_file); 
      if(spos > 0) SetPos(spos);     
    }
  } // OUTPUT
	
  else {  // INPUT
		
    if(m_filestat==SFERROR) {
      m_dataframes = 0;
      m_sr = 0.f;
      m_bits = 0;
      m_channels = 0;
      m_error = 21;
      return;
    }
		
    int IDchk;
    fread(&IDchk, 4, 1, m_file);
    if(!is_aiff_form(IDchk)){
      m_filestat = SFERROR;
      m_sr = 0.f;
      m_bits = 0;
      m_channels = 0;
      m_dataframes = 0;
      m_error = 25;
      return;
    }
		
    fseek(m_file, 4, SEEK_CUR);
    fread(&IDchk, 4, 1, m_file);
    if(IDchk != *(int *) FORM_TYPE){
      m_filestat = SFERROR;
      m_sr = 0.f;
      m_bits = 0;
      m_channels = 0;
      m_dataframes =0;
      m_error = 26;
      m_output = 0;
      return;
    }
		
    fseek(m_file, 0, SEEK_SET);
    if(!ReadHeader()){
      m_dataframes = 0;
      m_error = 27;
      m_output = 0; 
      return; 
			
    }
    m_bits = m_header.size;
    m_channels = m_header.nchns;
    m_dataframes = m_header.numSampleFrames;
    int datasize = m_dataframes*m_channels*m_sampsize;
    m_isaiff = true;
    m_itemsleft = (datasize%m_buffsize)/m_sampsize;
    m_spos=spos;          
    m_datapos = ftell(m_file);
    if(spos > 0) SetPos(spos); 
		
    delete[] m_output;
    delete[] m_buffer;
		
    m_samples = m_vecsize*m_channels;
    if(!(m_output = new float[m_samples])){
      m_error = 1;
      cout << ErrorMessage();
      return;
    }
		
    m_buffsize = (m_bits/8)*m_samples;
    if(!(m_buffer = new char[m_buffsize])){
      m_error = 11;
      cout << ErrorMessage();
      return;
    }
		
    // these are the pointers used to read the buffer
    m_cp = (unsigned char *) m_buffer;
    m_sp = (short *) m_buffer;
    m_lp = (int *) m_buffer;
    m_s24p = (_24Bit *) m_buffer;
		
  }  // INPUT
	
//.........这里部分代码省略.........
开发者ID:dskinner,项目名称:sndobj,代码行数:101,代码来源:SndAiff.cpp


示例6: ChangeEntry

void ChangeEntry(void)
{
  int dbid;
  DB_LIST parent;
  char name[256];
  int etype;
  char *comment;
  char comval[256];
  int ival;
  double rval;
  char sval[256];
  char choice[10];
  int ret;

  printf("\n\n");
  
  printf("Change an entry\n");
  printf("---------------\n");

  dbid = ChooseDatabase();
  if(dbid==-1) return;
 
  parent = ChooseParentList(dbid);

  printf("\nChoose entry name ==> ");
  scanf("%s", name);

  etype = eXdbmGetEntryType(dbid, parent, name);
  if(etype==-1) {
    printf("\nerror ==> entry not defined\n");
    HitKey();
    return;
  }

  printf("\nEntry values :\n");
  printf(  "------------\n\n");

  printf("[NAME] = %s\n\n", name);

  comment = eXdbmGetEntryComment(dbid, parent, name);

  if(comment!=NULL) 
    printf("[COMMENT] = %s\n\n", comment);
  
  printf("Do you want to specify a new comment (y/n) ? ");
  scanf("%s", choice);

  comment = NULL;

  if(toupper(choice[0])=='Y') {
    printf("[COMMENT] = ");
    fgets(comval,256,stdin);
    comment = comval;
  }

  if(comment!=NULL)
    eXdbmChangeEntryComment(dbid, parent, name, comment);
 
  switch(etype) {
  case DBM_ENTRY_LIST :
    printf("[TYPE] = List\n\n");
    printf("Cannot change a list entry\n");
    break;
    
  case DBM_ENTRY_VAR_INT :
    printf("[TYPE] = integer variable\n\n");
    printf("[VALUE] = ");
    scanf("%d", &ival);
    ret = eXdbmChangeVarInt(dbid, parent, name, ival);
    if(ret==-1) {
      ErrorMessage();
      HitKey();
      return;
    }
    break;

  case DBM_ENTRY_VAR_REAL :
    printf("[TYPE] = real number variable\n\n");
    printf("[VALUE] = ");
    scanf("%lf", &rval);
    ret = eXdbmChangeVarReal(dbid, parent, name, rval);
    if(ret==-1) {
      ErrorMessage();
      HitKey();
      return;
    }
    break;

  case DBM_ENTRY_VAR_BOOL :
    printf("[TYPE] = boolean variable\n\n");
    printf("[VALUE] = ");
    scanf("%s", sval);
    if(strcmp(sval, "FALSE")==0)
      ret = eXdbmChangeVarBool(dbid, parent, name, 0);
    else
      ret = eXdbmChangeVarBool(dbid, parent, name, 1);

    if(ret==-1) {
      ErrorMessage();
      HitKey();
//.........这里部分代码省略.........
开发者ID:fredokun,项目名称:cubevm,代码行数:101,代码来源:test3.c


示例7: result

    Position Position::read(Kernel::Reader* reader)
    {
      Position result(Distance::_Meter,0,0,0) ;
      
      std::map<std::string,std::string>::const_iterator finder ; 

      finder = reader->getAttributes().find("x") ;
      if (finder != reader->getAttributes().end())
      {
        result.m_value.x = atof(finder->second.c_str()) ;
      }
      else
      {
        ErrorMessage("Model::Position::read required attribute : x") ;
      }

      finder = reader->getAttributes().find("y") ;
      if (finder != reader->getAttributes().end())
      {
        result.m_value.y = atof(finder->second.c_str()) ;
      }
      else
      {
        ErrorMessage("Model::Position::read required attribute : y") ;
      }

      finder = reader->getAttributes().find("z") ;
      if (finder != reader->getAttributes().end())
      {
        result.m_value.z = atof(finder->second.c_str()) ;
      }
      else
      {
        ErrorMessage("Model::Position::read required attribute : z") ;
      }
      
      finder = reader->getAttributes().find("unit") ;
      if (finder != reader->getAttributes().end())
      {
        if (finder->second == "LightYear")
        {
          result.m_unit = Distance::_LightYear ;
        }
        else if (finder->second == "Parsec")
        {
          result.m_unit = Distance::_Parsec ;
        }
        else if (finder->second == "Meter")
        {
          result.m_unit = Distance::_Meter ;
        }
        else 
        {
          ErrorMessage("Model::Position::read invalid unit : " + finder->second) ;
        }
      }
      else
      {
        ErrorMessage("Model::Position::read required attribute : unit") ;
      }
      
      // move out of node
      while (!reader->isEndNode() && reader->processNode())
      {}
      
      reader->processNode() ;
      
      return result ;            
    }   
开发者ID:BackupTheBerlios,项目名称:projet-univers-svn,代码行数:69,代码来源:position.cpp


示例8: ErrorMessage

bool CSSOBuilder::LoginErrorMessage(int iSsoResult)
{
	if (iSsoResult == CANTLOGIN_MANDATORY_MISSING)
	{
		return ErrorMessage("CANT-LOGIN-MANDATORY-MISSING","Unable to log the user as their is a mandotory field missing");
	}
	else if (iSsoResult == CANTLOGIN_NOT_VALIDATED)
	{
		return ErrorMessage("CANT-LOGIN-NOT-VALIDATED","Unable to log the user as they need to validate their account");
	}
	else if (iSsoResult == CANTLOGIN_CHANGE_PASSWORD)
	{
		return ErrorMessage("CANT-LOGIN-CHANGE-PASSWORD","Unable to log the user as they need to change their password");
	}
	else if (iSsoResult == CANTLOGIN_NOT_REGISTERED)
	{
		return ErrorMessage("CANT-LOGIN-NOT-REGISTERED","Unable to log the user as their are not registered");
	}
	else if (iSsoResult == CANTLOGIN_SERVICE_AGREEMENT)
	{
		return ErrorMessage("CANT-LOGIN-SERVICE-AGREEMENT","Unable to log the user has not accepted their service agreement");
	}
	else if (iSsoResult == CANTLOGIN_GLOBAL_AGREEMENT)
	{
		return ErrorMessage("CANT-LOGIN-GLOBAL-AGREEMENT","Unable to log the user has not accepted their global agreement");
	}
	else if (iSsoResult == CANTLOGIN_SQBLOCK)
	{
		return ErrorMessage("CANT-LOGIN-SQBLOCK","Unable to log the user in as their was a secret question block");
	}
	else if (iSsoResult == CANTLOGIN_PASSBLOCK)
	{
		return ErrorMessage("CANT-LOGIN-PASSBLOCK","Unable to log the user in as their password has been blocked");
	}
	else if (iSsoResult == CANTLOGIN_BANNED)
	{
		return ErrorMessage("CANT-LOGIN-BANNED","Unable to log the user in as they were banned");
	}
	else if (iSsoResult == CANTLOGIN_INCORRECT_AUTHENTICATION_TYPE)
	{
		return ErrorMessage("INCORRECT-AUTHENTICATION-TYPE","Incorrect Authentication");
	}
	else if (iSsoResult == CANTLOGIN_NOT_VALID)
	{
		return ErrorMessage("CANT-LOGIN-NOT-VALID","The login is not valid");
	}

	return ErrorMessage("NO-SSO-RESULT","Unable to identify the result from Single Sign On");	

}
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:50,代码来源:SSOBuilder.cpp


示例9: SndIO

SndFIO::SndFIO(char* name, short mode, short channels, short bits,
	       SndObj** inputlist, float spos, int vecsize, float sr) :
  SndIO(channels, bits,inputlist,vecsize,sr){

  m_name = name;
  m_mode = mode;
  m_spos = spos; 
  m_datapos = 0;
  m_filestat = WAITOPEN;
  m_selfdesc = 0;
  m_eof=0;

  char* s_temp;

 
  switch (mode){  // open modes

  case INSERT:
    s_temp="r+b";
    break;

  case OVERWRITE:  
    s_temp="wb";
    break;

  case APPEND:
    s_temp="ab";
    m_datapos = 0;
    break;

  case READ:
    s_temp= "rb";
    if(!m_selfdesc) m_bits = bits;
    else m_bits = 0;
    break;

  default:
    m_error = 8;
#ifdef DEBUG
    cout << ErrorMessage();
#endif
    return;

  } 

  // open file
  if ((m_file = fopen(name,s_temp)) != NULL) m_filestat=SFOPEN;
  else{
    m_filestat=SFERROR;
    m_error=12;
#ifdef DEBUG
    cout << ErrorMessage();
#endif
    return;
  } 



  if(m_bits>0){
    m_buffsize = (m_bits/8)*m_samples;
    if(!(m_buffer = new char[m_buffsize])){
      m_error = 11;
#ifdef DEBUG
      cout << ErrorMessage();
#endif
      return;
    }
 
    // these are the pointers used to read/write to the buffer
    m_cp = (unsigned char *) m_buffer;
    m_sp = (short *) m_buffer;
    m_lp = (int *) m_buffer;
    m_s24p = (_24Bit*) m_buffer; 
  }
  else {
    m_buffsize = 0;
    m_buffer = 0;
    m_cp = 0;
    m_sp = 0;
    m_lp = 0;
  }
  if(m_bits != 16 && m_bits != 8 && m_bits != 32
     && m_bits != 24){
    m_error = 13;
#ifdef DEBUG
    cout << ErrorMessage();
#endif
  }
  if(spos > 0) SetPos(spos);
  m_safe = m_file;
}
开发者ID:dskinner,项目名称:sndobj,代码行数:91,代码来源:SndFIO.cpp


示例10: MakeNSISProc

DWORD WINAPI MakeNSISProc(LPVOID p) {
	char buf[1024];
	STARTUPINFO si={sizeof(si),};
	SECURITY_ATTRIBUTES sa={sizeof(sa),};
	SECURITY_DESCRIPTOR sd={0,};
	PROCESS_INFORMATION pi={0,};
	HANDLE newstdout=0,read_stdout=0; 

	OSVERSIONINFO osv={sizeof(osv)};
	GetVersionEx(&osv);
	if (osv.dwPlatformId == VER_PLATFORM_WIN32_NT) {
		InitializeSecurityDescriptor(&sd,SECURITY_DESCRIPTOR_REVISION);
		SetSecurityDescriptorDacl(&sd,true,NULL,false);
		sa.lpSecurityDescriptor = &sd;
	}
	else sa.lpSecurityDescriptor = NULL;
	sa.bInheritHandle = true;
	if (!CreatePipe(&read_stdout,&newstdout,&sa,0)) {
		ErrorMessage(g_hwnd,"There was an error creating the pipe.");
		PostMessage(g_hwnd,WM_MAKENSIS_PROCESSCOMPLETE,0,0);
		return 1;
	}
	GetStartupInfo(&si);
	si.dwFlags = STARTF_USESTDHANDLES|STARTF_USESHOWWINDOW;
	si.wShowWindow = SW_HIDE;
	si.hStdOutput = newstdout;
	si.hStdError = newstdout;
	if (!CreateProcess(NULL,g_script,NULL,NULL,TRUE,CREATE_NEW_CONSOLE,NULL,NULL,&si,&pi)) {
		char buf[MAX_STRING];
		wsprintf(buf,"Could not execute:\r\n %s.",g_script);
		ErrorMessage(g_hwnd,buf);
		CloseHandle(newstdout);
		CloseHandle(read_stdout);
		PostMessage(g_hwnd,WM_MAKENSIS_PROCESSCOMPLETE,0,0);
		return 1;
	}
	unsigned long exit=0,read,avail;
	my_memset(buf,0,sizeof(buf));
	while(1) {
		PeekNamedPipe(read_stdout,buf,sizeof(buf)-1,&read,&avail,NULL);
		if (read != 0) {
			my_memset(buf,0,sizeof(buf));
			if (avail > sizeof(buf)-1) 	{
				while (read >= sizeof(buf)-1) {
					ReadFile(read_stdout,buf,sizeof(buf)-1,&read,NULL);
					LogMessage(g_hwnd,buf);
					my_memset(buf,0,sizeof(buf));
				}
			}
			else {
				ReadFile(read_stdout,buf,sizeof(buf),&read,NULL);
				LogMessage(g_hwnd,buf);
			}			
		}
		GetExitCodeProcess(pi.hProcess,&exit);
		if (exit != STILL_ACTIVE) break;
		Sleep(TIMEOUT);
	}
	g_retcode = exit;
	CloseHandle(pi.hThread);
	CloseHandle(pi.hProcess);
	CloseHandle(newstdout);
	CloseHandle(read_stdout);
	PostMessage(g_hwnd,WM_MAKENSIS_PROCESSCOMPLETE,0,0);
	return 0;
}
开发者ID:kichik,项目名称:nsis-1,代码行数:66,代码来源:makensisw.cpp


示例11: main

int main(int argc, char* argv[])
{
    string              argument;
    ParserClass         parser;
    
	OpenSMOKE_ReactingGas		mix;
    OpenSMOKE_GlobalKinetics    global;
    OpenSMOKE_CSTR				cstr;
	OpenSMOKE_GasStream			inlet;
	OpenSMOKE_GasStream			outlet;
	OpenSMOKE_2EModel			soot2EModel;


    // 0. Parser setup
    parser.setup(argc, argv, parser_options);


    // 1. Detailed kinetic scheme setup
    if (parser.parse("--kinetics", argument))
            mix.SetupBinary(argument);
    else    ErrorMessage("The --kinetics option is compulsory");


    // 2a. Global kinetic scheme setup
    global.assign_mix(&mix);
    if (parser.parse("--global", argument))
    {
		global.read_from_file(argument);
		cstr.SetGlobalKinetics();
	}

	// 2b. Soot 2E Model
	if (parser.parse("--soot2EModel", argument))
	{
		soot2EModel.assign_mixture(mix);
		soot2EModel.setupFromFile(argument);
		cstr.SetTwoEquationModel();
	}
    // 3. Inlet stream setup
    inlet.AssignKineticScheme(mix);
    if (parser.parse("--inlet", argument))
		inlet.DefineFromFile(argument);
    else    ErrorMessage("The --inlet option is compulsory");
	inlet.VideoSummary();

	// Output folder
    if (parser.parse("--output", argument))
		cstr.SetOutputFolder(argument);


    // 4. CSTR Setup
    cstr.AssignKineticScheme(mix);
    cstr.AssignGlobalKineticScheme(global);
	cstr.AssignSoot2EModel(soot2EModel);

	cstr.AssignInletFlows(inlet);
    if (parser.parse("--input", argument))
		cstr.DefineFromFile(argument);
    else    ErrorMessage("The --input option is compulsory");


    // 5. PFR Video Summary
    cstr.VideoSummary();

    // 6. PFR Solution
    cstr.Solve();

    // 7. Video Solution
    cstr.VideoFinalResult();

	// 8. Outlet Stream
	cstr.OutletStream(outlet);
	outlet.VideoSummary();

	// 9. Mass and Energy balance
	cstr.SummaryOnFile();
	cstr.MassAnalysis(outlet);
	cstr.EnergyAnalysis(outlet);

    OpenSMOKE_logo("OpenSMOKE_CSTR", "0.3", "January 2014");

    return 0;
}
开发者ID:acuoci,项目名称:OpenSMOKE,代码行数:83,代码来源:OpenSMOKE_CSTR.cpp


示例12: LoadLayerTypeInfo

void LoadLayerTypeInfo(CCEtoODBDoc *doc, const char *filename)
{
   CWaitCursor();
   
	// try reading an xml layertype file first
	LayerTypeXMLReader reader(*doc);
	FileStatusTag retval = reader.open(filename);

	// if not successful, then assume its the old one
	if (retval == statusSucceeded)
	{
		// init
		for (int i=0; i<MAX_LAYERSETS; i++)
		{
			for (int j=0; j<MAX_LAYTYPE; j++)
			{
				doc->LayerTypeArray[i][j].color = RGB(255, 255, 255);
				doc->LayerTypeArray[i][j].show = false;
			}
		}

		//reader.setDoc(doc);

		retval = reader.parse();
		
		return;
	}

	FILE *stream;
   if ((stream = fopen(filename, "rt")) == NULL)
   {
      ErrorMessage(filename, "Unable to open file");
      return;
   }

   char     line[500], *tok;
   int      i, j;
   int      version = 1;

   if (fgets(line,500,stream) == NULL)
      return;

   if (strcmp(line, "! Layertype Information\n"))
   {
      if (!strcmp(line, "! Layertype Information V2\n"))
      {
         version = 2;
      }
      else
      if (!strcmp(line, "! Layertype Information V3\n"))
      {
         version = 3;
      }
      else
      {
         ErrorMessage("This is not a Layertype Information File");
         return;
      }
   }

   // init
   for (i=0; i<MAX_LAYERSETS; i++)
   {
      for (j=0; j<MAX_LAYTYPE; j++)
      {
         doc->LayerTypeArray[i][j].color = RGB(255, 255, 255);
         doc->LayerTypeArray[i][j].show = false;
      }
   }

   if (version == 1)
   {
      int red, green, blue;
      for (i=0; i<MAX_LAYERSETS; i++)  // Normal, Top, Bottom, Cust 1, 2, 3, 4, 5
      {
         j=0;
         while (j<31)   // this was 31 before version 2
         {
            if (fgets(line,500,stream) == NULL) return;
   
            if (line[0] == '!' || line[0] == '\n') continue; // remark

            if ((tok = strtok(line, " \t\n(),")) == NULL) continue;
            doc->LayerTypeArray[i][j].show = atoi(tok);

            if ((tok = strtok(NULL, " \t\n(),")) == NULL) continue;
            red = atoi(tok);

            if ((tok = strtok(NULL, " \t\n(),")) == NULL) continue;
            green = atoi(tok);

            if ((tok = strtok(NULL, " \t\n(),")) == NULL) continue;
            blue = atoi(tok);

            doc->LayerTypeArray[i][j].color = RGB(red, green, blue);

            j++;
         }
      }
   }
//.........这里部分代码省略.........
开发者ID:mpatwa,项目名称:CCEtoODB_Translator,代码行数:101,代码来源:LyrType.cpp


示例13: PrintValues

void PrintValues(void)
{
  int dbid;
  DB_LIST parent;
  char name[256];
  int etype;
  char *comment;
  DB_LIST list;
  long ival;
  double rval;
  char *sval;

  printf("\n\n");
  
  printf("Values of an entry\n");
  printf("------------------\n");

  dbid = ChooseDatabase();
  if(dbid==-1) return;
 
  parent = ChooseParentList(dbid);

  printf("\nChoose entry name ==> ");
  scanf("%s", name);

  etype = eXdbmGetEntryType(dbid, parent, name);
  if(etype==-1) {
    ErrorMessage();
    HitKey();
    return;
  }

  printf("\nEntry values :\n");
  printf(  "------------\n\n");

  printf("[NAME] = %s\n\n", name);

  comment = eXdbmGetEntryComment(dbid, parent, name);
  if(comment!=NULL)
    printf("[COMMENT] = %s\n\n", comment);


  switch(etype) {
  case DBM_ENTRY_LIST :
    printf("[TYPE] = List\n\n");
    list = eXdbmGetList(dbid, parent, name);
    printf("Info : This list contains %d entries\n\n", list->current_order);
    break;
    
  case DBM_ENTRY_VAR_INT :
    printf("[TYPE] = integer variable\n\n");
    eXdbmGetVarInt(dbid, parent, name, &ival);
    printf("[VALUE] = %ld\n\n", ival);
    break;

  case DBM_ENTRY_VAR_REAL :
    printf("[TYPE] = real number variable\n\n");
    eXdbmGetVarReal(dbid, parent, name, &rval);
    printf("[VALUE] = %f\n\n", rval);
    break;

  case DBM_ENTRY_VAR_BOOL :
    printf("[TYPE] = boolean variable\n\n");
    eXdbmGetVarBool(dbid, parent, name, &ival);
    if(ival==0)
      printf("[VALUE] = FALSE\n\n");
    else 
      printf("[VALUE] = TRUE\n\n");
    break;

  case DBM_ENTRY_VAR_STRING :
    printf("[TYPE] = string variable\n\n");
    eXdbmGetVarString(dbid, parent, name, &sval);
    printf("[VALUE] = %s\n\n", sval);
    free(sval);
    break;

  case DBM_ENTRY_VAR_IDENT :
    printf("[TYPE] = identifier variable\n\n");
    eXdbmGetVarIdent(dbid, parent, name, &sval);
    printf("[VALUE] = %s\n\n", sval);
    free(sval);
    break;

  }

  HitKey();

}
开发者ID:fredokun,项目名称:cubevm,代码行数:89,代码来源:test3.c


示例14: GetMNAPattern

void CRusSemStructure::BuildMNAOutcoming(long ClauseNo)
{
 try {
  

  for (long NodeNo = 0;  NodeNo < m_Nodes.size(); NodeNo++)
    if (   IsInClause(NodeNo, ClauseNo)
		&& ( m_Nodes[NodeNo].m_NodeType == MNA ) 
		&& ( m_Nodes[NodeNo].m_MNAType != CHEMOborot)
	   )
	{
		long  PatternPoses;
		QWORD Grammems;
		GetMNAPattern(NodeNo, PatternPoses, Grammems);
		bool bAdjMNA = HasOutcomingSynRelation(NodeNo,"ОДНОР_ПРИЛ");
		
        // мы начинаем поиск левых потомков от оператора однородности 
		// (единственный правый потомок уже был присоединен в процедуре, которая ищет оператор однородности )
	    for (long LeftChildNo=NodeNo; LeftChildNo >= m_Clauses[ClauseNo].m_BeginNodeNo; LeftChildNo--)
		{
			// ищем запятую, союз  или какой другой  оператор однородности
			for (; LeftChildNo >= m_Clauses[ClauseNo].m_BeginNodeNo; LeftChildNo--)
				if (IsFiniteVerb(LeftChildNo))
					  goto NoMoreLeftChilds;
				else
					if (   IsCoordConj(LeftChildNo) 
						|| m_Nodes[LeftChildNo].HaveCommaAfter()
						|| (m_Nodes[LeftChildNo].m_NodeType == MNA)
						)
					break;
			if (LeftChildNo <  m_Clauses[ClauseNo].m_BeginNodeNo) break; // не нашли

			// ищем слово, которое согласовано со словом, которое стоит сразу же  за оператором однородности, по падежу
			// или вообще не имеет граммем (ИЛЕ)
			for (; LeftChildNo >= m_Clauses[ClauseNo].m_BeginNodeNo; LeftChildNo--)
				if (IsFiniteVerb(LeftChildNo))
					goto NoMoreLeftChilds;
				else
				if (   (m_Nodes[LeftChildNo].m_MainWordNo != -1)
					&& (   !m_Nodes[LeftChildNo].IsTimeRossNode() 
						|| m_Nodes[LeftChildNo].IsMainTimeRossNode()
					   )
					&& (    ((m_Nodes[LeftChildNo].m_Words[m_Nodes[LeftChildNo].m_MainWordNo].m_Poses & PatternPoses) > 0)
					    ||  (     ( ( PatternPoses & (1<<ADV) ) > 0)
							  &&  (    m_Nodes[LeftChildNo].HasSomePrep() //  в лесу
								    || m_Nodes[LeftChildNo].IsMainTimeRossNode() // 9 мая	
								  )
							  &&  !HasIncomingNotWeakSynRelation(LeftChildNo)
						    )
					   )
					&& (  ((m_Nodes[LeftChildNo].GetGrammems() & Grammems & rAllCases) > 0)
						|| (Grammems == 0)
						|| (( PatternPoses & (1<<ADV) ) > 0)
						|| ( m_Nodes[LeftChildNo].GetGrammems() & Grammems & _QM(rComparative)) 
						|| ( HasSynRelation (LeftChildNo, "АНАТ_СРАВН") && (Grammems & _QM(rComparative)))
						)
					&& (!bAdjMNA || ( m_Nodes[LeftChildNo].HasPOS(ADJ_FULL) || m_Nodes[LeftChildNo].HasPOS(ADJ_SHORT)) )	
				   )
				break;
			if (LeftChildNo <  m_Clauses[ClauseNo].m_BeginNodeNo) break; 

			if (FindFirstRelation(NodeNo, LeftChildNo) == -1)
			{
				AddRelation(CRusSemRelation(CValency(), NodeNo, LeftChildNo,  ""));
				m_Relations[m_Relations.size() - 1].m_CannotHaveOnlyCommaBetween = true;
			};


		};
		NoMoreLeftChilds:;
	
	};

	}
 catch (...)
 {
	 ErrorMessage ("BuildMNAOutcoming Failed");
	 throw;
 };

};
开发者ID:deNULL,项目名称:seman,代码行数:81,代码来源:SemanticMNA.cpp


示例15: AddEntry

void AddEntry(void)
{
  int dbid;
  DB_LIST parent;
  char name[256];
  int etype;
  char *comment;
  char comval[256];
  int ival;
  double rval;
  char sval[256];
  char choice[10];
  int ret;

  printf("\n\n");
  
  printf("Create an entry\n");
  printf("---------------\n");

  dbid = ChooseDatabase();
  if(dbid==-1) return;
 
  parent = ChooseParentList(dbid);

  printf("\nChoose entry name ==> ");
  scanf("%s", name);

  etype = eXdbmGetEntryType(dbid, parent, name);
  if(etype!=-1) {
    printf("\nerror ==> entry already defined\n");
    HitKey();
    return;
  }

  printf("\nEntry values :\n");
  printf(  "------------\n\n");

  printf("[NAME] = %s\n\n", name);

  printf("Do you want to specify a comment (y/n) ? ");
  scanf("%s", choice);

  comment = NULL;

  if(toupper(choice[0])=='Y') {
    printf("[COMMENT] = ");
    fgets(comval,256,stdin);
    comment = comval;
  }
  
  etype = 0;

  while(etype<1 || etype > 6) {
    printf("\nChoose the type of the entry :\n\n");
    printf("1 => integer\n");
    printf("2 => real\n");
    printf("3 => bool\n");
    printf("4 => string\n");
    printf("5 => idenfifier\n");
    printf("6 => list\n");
    
    printf("\n  Your choice ==> ");
    etype=0;
    scanf("%d", &etype);
    if(etype==0) scanf("%s", choice);
  }

  etype--;

  switch(etype) {
  case DBM_ENTRY_LIST :
    printf("[TYPE] = List\n\n");
    ret = eXdbmCreateList(dbid, parent, name, comment);
    if(ret==-1) {
      ErrorMessage();
      HitKey();
      return;
    }
    break;
    
  case DBM_ENTRY_VAR_INT :
    printf("[TYPE] = integer variable\n\n");
    printf("[VALUE] = ");
    scanf("%d", &ival);
    ret = eXdbmCreateVarInt(dbid, parent, name, comment, ival);
    if(ret==-1) {
      ErrorMessage();
      HitKey();
      return;
    }
    break;

  case DBM_ENTRY_VAR_REAL :
    printf("[TYPE] = real number variable\n\n");
    printf("[VALUE] = ");
    scanf("%lf", &rval);
    ret = eXdbmCreateVarReal(dbid, parent, name, comment, rval);
    if(ret==-1) {
      ErrorMessage();
      HitKey();
//.........这里部分代码省略.........
开发者ID:fredokun,项目名称:cubevm,代码行数:101,代码来源:test3.c


示例16: UpdateBlockedRelations

void CRusSemStructure::BuildMNAIncoming(long ClauseNo)
{
 UpdateBlockedRelations();
 try {
  for (long NodeNo = m_Clauses[ClauseNo].m_BeginNodeNo;  NodeNo < m_Clauses[ClauseNo].m_EndNodeNo; NodeNo++)
    if (m_Nodes[NodeNo].m_NodeType == MNA)
	  for (long i = m_Clauses[ClauseNo].m_BeginNodeNo;  i < m_Clauses[ClauseNo].m_EndNodeNo; i++)
		   if  (i != NodeNo)
			 for (size_t j=0; j < m_Nodes[i].m_OutRels.size();j++)
			 {
				long Count = 0;
				/*
				   считаем кол-во отношений с одинаковым названием (это варианты заполнения одной валентности)
				   идущих из узла i (потенциальный хозяин однородного ряда) в
				   в члены однородного ряда.
				   Норамально, когда все члены однородного ряда подчиняются узлу i.
				   		
				*/
			    for (size_t l=j; l < m_Nodes[i].m_OutRels.size();l++)
				  if(m_Relations[m_Nodes[i].m_OutRels[j]].m_Valency == m_Relations[m_Nodes[i].m_OutRels[l]].m_Valency)
				  {
					  long k=0;
					  for (; k < m_Nodes[NodeNo].m_OutRels.size(); k++)
						if (m_Relations[m_Nodes[NodeNo].m_OutRels[k]].m_TargetNodeNo == m_Relations[m_Nodes[i].m_OutRels[l]].m_TargetNodeNo)
							break;

					  if (k <	m_Nodes[NodeNo].m_OutRels.size())
						Count++;
				  };

				// Для простых операторов однородности нужно, чтобы хотя бы один узел входил  
				// в член однородного ряда,чтобы подчинить весь однородный ряд. Это сделано из-за случая:
				// 'я жил в Америке и России'. Здесь пропущен прдлог 'в' после союза, поэтому
				// 'России'не подсоединится к 'жить'.
				// Для сравнительного оборота такой эллипсис не возможен, например:
				// Я жил в Америке дольше, чем в России.
				// но возможны обороты:
				// Я не знаю человека, больше чем Вася (здесь "Вася" не стоит в рд.  или  вн.) 
				// Я не отдаю тебе охотнее его (здесь "его" стоит в рд.) 
				if (    (   (Count > 0)
					//	&& (m_Nodes[NodeNo].m_MNAType != CHEMOborot)
					   )
				   /*||  (   (Count > 1) // 
						&& (m_Nodes[NodeNo].m_MNAType == CHEMOborot)
					   )*/
				   )
				{
				  // если валентность слова А - непредложная, а оператору однородности приписан предлог
				  // (такой предлог может придти из синтаксиса), тогда считаем, что слово А
				  // не может управлят этим однородным рядом
				   if (m_Relations[m_Nodes[i].m_OutRels[j]].m_Valency.IsFromDict())
				   {
					  const CRossHolder* RossHolder =  m_Relations[m_Nodes[i].m_OutRels[j]].m_Valency.m_RossHolder;
					  const TCortege& C = m_Relations[m_Nodes[i].m_OutRels[j]].m_SynReal.m_Cortege;
					  bool IsPrepCortege =     RossHolder->IsLemGroupBegining(RossHolder->GetSynFet(C)) 
											|| (RossHolder->GetSynRel(C) == RossHolder->AdverbialGrpNo);
					  if (!IsPrepCortege && m_Nodes[NodeNo].HasSomePrep()) continue;

				   };
				    

				  AddRelation(CRusSemRelation(m_Relations[m_Nodes[i].m_OutRels[j]].m_Valency, i, NodeNo,  ""));
		          m_Relations[m_Relations.size() - 1].m_CannotHaveOnlyCommaBetween = true;
				  m_Relations[m_Relations.size() - 1].m_SynReal = m_Relations[m_Nodes[i].m_OutRels[j]].m_SynReal;
				  m_Relations[m_Relations.size() - 1].m_SyntacticRelation = m_Relations[m_Nodes[i].m_OutRels[j]].m_SyntacticRelation;
				  if (m_Nodes[NodeNo].m_MNAType == CHEMOborot)
					  m_Relations[m_Relations.size() - 1].m_SemFets = GetSemFetsOfFirstValency(NodeNo);
				};

		   };


 }
 catch (...)
 {
	 ErrorMessage ("BuildMNAIncoming Failed");
	 throw;
 };
};
开发者ID:deNULL,项目名称:seman,代码行数:79,代码来源:SemanticMNA.cpp


示例17: DeleteEntry

void DeleteEntry(void)
{
  int dbid;
  DB_LIST parent;
  char name[256];
  int etype;
  char *comment = NULL;
  char choice[10];
  int ret;

  printf("\n\n");
  
  printf("Delete an entry\n");
  printf("---------------\n");

  dbid = ChooseDatabase();
  if(dbid==-1) return;
 
  parent = ChooseParentList(dbid);

  printf("\nChoose entry name ==> ");
  scanf("%s", name);

  etype = eXdbmGetEntryType(dbid, parent, name);
  if(etype==-1) {
    printf("\nerror ==> entry not defined\n");
    HitKey();
    return;
  }

  printf("\nEntry values :\n");
  printf(  "------------\n\n");

  printf("[NAME] = %s\n\n", name);

  if(comment!=NULL)
    eXdbmChangeEntryComment(dbid, parent, name, comment);
 
  switch(etype) {
  case DBM_ENTRY_LIST :
    printf("[TYPE] = List\n\n");
    printf("Cannot change a list entry\n");
    break;
    
  case DBM_ENTRY_VAR_INT :
    printf("[TYPE] = integer variable\n\n");
    break;

  case DBM_ENTRY_VAR_REAL :
    printf("[TYPE] = real number variable\n\n");
    break;

  case DBM_ENTRY_VAR_BOOL :
    printf("[TYPE] = boolean variable\n\n");
    break;


  case DBM_ENTRY_VAR_STRING :
    printf("[TYPE] = string variable\n\n");
    break;


  case DBM_ENTRY_VAR_IDENT :
    printf("[TYPE] = identifier variable\n\n");
    break;

  }


  printf("Do you want to erase this variable (y/n) ? ");
  scanf("%s", choice);

  if(toupper(choice[0])=='Y') {
    ret = eXdbmDeleteEntry(dbid, parent, name);
    if(ret==-1) {
      ErrorMessage();
      HitKey();
      return;
    }
    printf("\nEntry deleted successfully\n");
  } else printf("\nEntry not deleted\n");
  
  HitKey();

}
开发者ID:fredokun,项目名称:cubevm,代码行数:85,代码来源:test3.c


示例18: SuckFilefromSpec

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ErrorMessageBox函数代码示例发布时间:2022-05-30
下一篇:
C++ ErrorInvalidOperation函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap