您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ Close函数代码示例

51自学网 2021-06-01 20:11:36
  C++
这篇教程C++ Close函数代码示例写得很实用,希望能帮到您。

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

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

示例1: Close

/* MainWindow::handleAction * Handles the action [id]. Returns true if the action was handled, * false otherwise *******************************************************************/bool MainWindow::handleAction(string id){	// We're only interested in "main_" actions	if (!id.StartsWith("main_"))		return false;	// File->Exit	if (id == "main_exit")	{		Close();		return true;	}	// Edit->Undo	if (id == "main_undo")	{		panel_archivemanager->undo();		return true;	}	// Edit->Redo	if (id == "main_redo")	{		panel_archivemanager->redo();		return true;	}	// Edit->Set Base Resource Archive	if (id == "main_setbra")	{		wxDialog dialog_ebr(this, -1, "Edit Base Resource Archives", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER);		BaseResourceArchivesPanel brap(&dialog_ebr);		wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);		sizer->Add(&brap, 1, wxEXPAND|wxALL, 4);		sizer->Add(dialog_ebr.CreateButtonSizer(wxOK|wxCANCEL), 0, wxEXPAND|wxLEFT|wxRIGHT|wxDOWN, 4);		dialog_ebr.SetSizer(sizer);		dialog_ebr.Layout();		dialog_ebr.SetInitialSize(wxSize(500, 300));		dialog_ebr.CenterOnParent();		if (dialog_ebr.ShowModal() == wxID_OK)			theArchiveManager->openBaseResource(brap.getSelectedPath());		return true;	}	// Edit->Preferences	if (id == "main_preferences")	{		PreferencesDialog::openPreferences(this);		return true;	}	// View->Archive Manager	if (id == "main_showam")	{		wxAuiManager* m_mgr = wxAuiManager::GetManager(panel_archivemanager);		wxAuiPaneInfo& p_inf = m_mgr->GetPane("archive_manager");		p_inf.Show(!p_inf.IsShown());		m_mgr->Update();		return true;	}	// View->Console	if (id == "main_showconsole")	{		wxAuiManager* m_mgr = wxAuiManager::GetManager(panel_archivemanager);		wxAuiPaneInfo& p_inf = m_mgr->GetPane("console");		p_inf.Show(!p_inf.IsShown());		p_inf.MinSize(200, 128);		m_mgr->Update();		return true;	}	// View->Undo History	if (id == "main_showundohistory")	{		wxAuiManager* m_mgr = wxAuiManager::GetManager(panel_archivemanager);		wxAuiPaneInfo& p_inf = m_mgr->GetPane("undo_history");		p_inf.Show(!p_inf.IsShown());		m_mgr->Update();		return true;	}	// Help->About	if (id == "main_about")	{		wxAboutDialogInfo info;		info.SetName("SLADE");		info.SetVersion("v" + Global::version);		info.SetWebSite("http://slade.mancubus.net");		info.SetDescription("It's a Doom Editor");//.........这里部分代码省略.........
开发者ID:jonrimmer,项目名称:SLADE,代码行数:101,


示例2: Close

CLog4zFile::~CLog4zFile(){	Close();}
开发者ID:854825967,项目名称:zsummer,代码行数:4,


示例3: switch

bool CGUIDialogSelect::OnMessage(CGUIMessage& message){  switch ( message.GetMessage() )  {  case GUI_MSG_WINDOW_DEINIT:    {      CGUIDialog::OnMessage(message);      m_viewControl.Clear();      m_bButtonEnabled = false;      m_useDetails = false;      m_multiSelection = false;      // construct selected items list      m_selectedItems->Clear();      m_iSelected = -1;      for (int i = 0 ; i < m_vecList->Size() ; i++)      {        CFileItemPtr item = m_vecList->Get(i);        if (item->IsSelected())        {          m_selectedItems->Add(item);          if (m_iSelected == -1)            m_iSelected = i;        }      }      m_vecList->Clear();      m_buttonString = -1;      SET_CONTROL_LABEL(CONTROL_BUTTON, "");      return true;    }    break;  case GUI_MSG_WINDOW_INIT:    {      CGUIDialog::OnMessage(message);      return true;    }    break;  case GUI_MSG_CLICKED:    {      int iControl = message.GetSenderId();      if (m_viewControl.HasControl(CONTROL_LIST))      {        int iAction = message.GetParam1();        if (ACTION_SELECT_ITEM == iAction || ACTION_MOUSE_LEFT_CLICK == iAction)        {          int iSelected = m_viewControl.GetSelectedItem();          if(iSelected >= 0 && iSelected < (int)m_vecList->Size())          {            CFileItemPtr item(m_vecList->Get(iSelected));            if (m_multiSelection)              item->Select(!item->IsSelected());            else            {              for (int i = 0 ; i < m_vecList->Size() ; i++)                m_vecList->Get(i)->Select(false);              item->Select(true);              m_bConfirmed = true;              Close();            }          }        }      }      if (CONTROL_BUTTON == iControl)      {        m_iSelected = -1;        m_bButtonPressed = true;        if (m_multiSelection)          m_bConfirmed = true;        Close();      }    }    break;  case GUI_MSG_SETFOCUS:    {      // make sure the additional button is focused in case the list is empty      // (otherwise it is impossible to navigate to the additional button)      if (m_vecList->IsEmpty() && m_bButtonEnabled &&          m_viewControl.HasControl(message.GetControlId()))      {        SET_CONTROL_FOCUS(CONTROL_BUTTON, 0);        return true;      }      if (m_viewControl.HasControl(message.GetControlId()) && m_viewControl.GetCurrentControl() != message.GetControlId())      {        m_viewControl.SetFocused();        return true;      }    }    break;  }  return CGUIDialog::OnMessage(message);}
开发者ID:Distrotech,项目名称:xbmc,代码行数:99,


示例4: Close

// -------------------------------------------------------------------------------- //void guSplashFrame::OnSplashClick( wxMouseEvent &event ){    Close();}
开发者ID:anonbeat,项目名称:guayadeque,代码行数:5,


示例5: Close

//***************************************************************************CBCGPDAOGridCtrl::~CBCGPDAOGridCtrl(){	Close ();}
开发者ID:cugxiangzhenwei,项目名称:WorkPlatForm,代码行数:5,


示例6: Close

VDFileAsync9x::~VDFileAsync9x() {	Close();}
开发者ID:KGE-INC,项目名称:VirtualDub,代码行数:3,


示例7: Close

void CustomEdit::scheduleCreated(int ruleID){    if (ruleID > 0)        Close();}
开发者ID:tomhughes,项目名称:mythtv,代码行数:5,


示例8: WXUNUSED

void MyChild::OnQuit(wxCommandEvent& WXUNUSED(event)){    Close(true);}
开发者ID:nealey,项目名称:vera,代码行数:4,


示例9: lock

bool COMXVideo::Open(CDVDStreamInfo &hints, OMXClock *clock, EDEINTERLACEMODE deinterlace, bool hdmi_clock_sync){  CSingleLock lock (m_critSection);  bool vflip = false;  Close();  OMX_ERRORTYPE omx_err   = OMX_ErrorNone;  std::string decoder_name;  m_settings_changed = false;  m_setStartTime = true;  m_res_ctx           = NULL;  m_res_callback      = NULL;  m_video_codec_name      = "";  m_codingType            = OMX_VIDEO_CodingUnused;  m_decoded_width  = hints.width;  m_decoded_height = hints.height;  m_hdmi_clock_sync = hdmi_clock_sync;  m_submitted_eos = false;  m_failed_eos    = false;  if(hints.extrasize > 0 && hints.extradata != NULL)  {    m_extrasize = hints.extrasize;    m_extradata = (uint8_t *)malloc(m_extrasize);    memcpy(m_extradata, hints.extradata, hints.extrasize);  }  switch (hints.codec)  {    case AV_CODEC_ID_H264:    {      switch(hints.profile)      {        case FF_PROFILE_H264_BASELINE:          // (role name) video_decoder.avc          // H.264 Baseline profile          decoder_name = OMX_H264BASE_DECODER;          m_codingType = OMX_VIDEO_CodingAVC;          m_video_codec_name = "omx-h264";          break;        case FF_PROFILE_H264_MAIN:          // (role name) video_decoder.avc          // H.264 Main profile          decoder_name = OMX_H264MAIN_DECODER;          m_codingType = OMX_VIDEO_CodingAVC;          m_video_codec_name = "omx-h264";          break;        case FF_PROFILE_H264_HIGH:          // (role name) video_decoder.avc          // H.264 Main profile          decoder_name = OMX_H264HIGH_DECODER;          m_codingType = OMX_VIDEO_CodingAVC;          m_video_codec_name = "omx-h264";          break;        case FF_PROFILE_UNKNOWN:          decoder_name = OMX_H264HIGH_DECODER;          m_codingType = OMX_VIDEO_CodingAVC;          m_video_codec_name = "omx-h264";          break;        default:          decoder_name = OMX_H264HIGH_DECODER;          m_codingType = OMX_VIDEO_CodingAVC;          m_video_codec_name = "omx-h264";          break;      }    }    break;    case AV_CODEC_ID_MPEG4:      // (role name) video_decoder.mpeg4      // MPEG-4, DivX 4/5 and Xvid compatible      decoder_name = OMX_MPEG4_DECODER;      m_codingType = OMX_VIDEO_CodingMPEG4;      m_video_codec_name = "omx-mpeg4";      break;    case AV_CODEC_ID_MPEG1VIDEO:    case AV_CODEC_ID_MPEG2VIDEO:      // (role name) video_decoder.mpeg2      // MPEG-2      decoder_name = OMX_MPEG2V_DECODER;      m_codingType = OMX_VIDEO_CodingMPEG2;      m_video_codec_name = "omx-mpeg2";      break;    case AV_CODEC_ID_H263:      // (role name) video_decoder.mpeg4      // MPEG-4, DivX 4/5 and Xvid compatible      decoder_name = OMX_MPEG4_DECODER;      m_codingType = OMX_VIDEO_CodingMPEG4;      m_video_codec_name = "omx-h263";      break;    case AV_CODEC_ID_VP6:      // this form is encoded upside down      vflip = true;      // fall through    case AV_CODEC_ID_VP6F:    case AV_CODEC_ID_VP6A:      // (role name) video_decoder.vp6      // VP6//.........这里部分代码省略.........
开发者ID:BenxiangGe,项目名称:boxeebox-xbmc,代码行数:101,


示例10: PartitionInfo

//.........这里部分代码省略.........	BYTE bLayoutInfo[20240];	DISK_GEOMETRY dg;	for( int iDrive = 0; iDrive < 8; iDrive++ )	{		if( !Open(iDrive) )			continue;		if( GetDriveGeometryEx( (DISK_GEOMETRY_EX*) bLayoutInfo, sizeof(bLayoutInfo) ) )		{			DISK_GEOMETRY& dgref = (((DISK_GEOMETRY_EX*)bLayoutInfo)->Geometry);			dg = dgref;			PartitionInfo* p = new PartitionInfo();			p->m_dwDrive = (DWORD) iDrive;			p->m_dwPartition = 0;			p->m_bIsPartition = FALSE; //! was TRUE. -AEB			p->m_dwBytesPerSector = dg.BytesPerSector;			p->m_NumberOfSectors = dg.Cylinders.QuadPart;			p->m_NumberOfSectors *= dg.SectorsPerTrack;			p->m_NumberOfSectors *= dg.TracksPerCylinder;			p->m_StartingOffset = 0;			p->m_StartingSector = 0;			p->m_PartitionLength = p->m_NumberOfSectors;			p->m_PartitionLength *= dg.BytesPerSector;			list.push_back(p);			if( GetDriveLayoutEx( bLayoutInfo, sizeof(bLayoutInfo) ) )			{				PDRIVE_LAYOUT_INFORMATION_EX pLI = (PDRIVE_LAYOUT_INFORMATION_EX)bLayoutInfo;				for( DWORD iPartition = 0; iPartition < pLI->PartitionCount; iPartition++ )				{					PARTITION_INFORMATION_EX* pi = &(pLI->PartitionEntry[iPartition]);					PartitionInfo* p = new PartitionInfo();					p->m_dwDrive = (DWORD) iDrive;					p->m_dwPartition = (DWORD) iPartition;					p->m_bIsPartition = TRUE;					p->m_dwBytesPerSector = dg.BytesPerSector;					p->m_NumberOfSectors = pi->PartitionLength.QuadPart;					p->m_NumberOfSectors /= dg.BytesPerSector;					p->m_StartingOffset = pi->StartingOffset.QuadPart;					p->m_StartingSector = p->m_StartingOffset;					p->m_StartingSector /= dg.BytesPerSector;					p->m_PartitionLength = pi->PartitionLength.QuadPart;                    if (pi->PartitionStyle == PARTITION_STYLE_MBR)                    {                        p->m_nPartitionType = pi->Mbr.PartitionType;                    }					list.push_back(p);				}			}		}		else		{			if( GetDriveGeometry( &dg ) )			{				PartitionInfo* p = new PartitionInfo();				p->m_dwDrive = (DWORD) iDrive;				p->m_dwPartition = 0;				p->m_bIsPartition = FALSE;				p->m_dwBytesPerSector = dg.BytesPerSector;				p->m_NumberOfSectors = dg.Cylinders.QuadPart;				p->m_NumberOfSectors *= dg.SectorsPerTrack;				p->m_NumberOfSectors *= dg.TracksPerCylinder;				p->m_StartingOffset = 0;				p->m_StartingSector = 0;				p->m_PartitionLength = p->m_NumberOfSectors;				p->m_PartitionLength *= dg.BytesPerSector;				list.push_back(p);				if( GetDriveLayout( bLayoutInfo, sizeof(bLayoutInfo) ) )				{					PDRIVE_LAYOUT_INFORMATION pLI = (PDRIVE_LAYOUT_INFORMATION)bLayoutInfo;					for( DWORD iPartition = 0; iPartition < pLI->PartitionCount; iPartition++ )					{						PARTITION_INFORMATION* pi = &(pLI->PartitionEntry[iPartition]);						if( !pi->PartitionLength.QuadPart )							continue;						PartitionInfo* p = new PartitionInfo();						p->m_dwDrive = (DWORD) iDrive;						p->m_dwPartition = (DWORD) iPartition;						p->m_bIsPartition = TRUE;						p->m_dwBytesPerSector = dg.BytesPerSector;						p->m_NumberOfSectors = pi->PartitionLength.QuadPart;						p->m_NumberOfSectors /= dg.BytesPerSector;						p->m_StartingOffset = pi->StartingOffset.QuadPart;						p->m_StartingSector = p->m_StartingOffset;						p->m_StartingSector /= dg.BytesPerSector;						p->m_PartitionLength = pi->PartitionLength.QuadPart;						list.push_back(p);					}				}			}		}		Close();	}}
开发者ID:pulsa,项目名称:t.hex,代码行数:101,


示例11: WXUNUSED

void MyFrame::OnClose(wxCommandEvent& WXUNUSED(event)){    // true is to force the frame to close    Close(true);}
开发者ID:euler0,项目名称:Helium,代码行数:5,


示例12: Close

DBConnector::~DBConnector(){	Close();	mysql_shutdown(&mysql, SHUTDOWN_DEFAULT);}
开发者ID:ak4hige,项目名称:myway3d,代码行数:5,


示例13: Close

Fd::~Fd(){	if(IsAcquired())		Close();}
开发者ID:peku33,项目名称:HikVision-EventReceiver,代码行数:5,


示例14: Close

void __fastcall TAPAffirmAndNotBookForm::btnExitClick(TObject *Sender){	Close();	}
开发者ID:25311753,项目名称:asi,代码行数:4,


示例15: Close

CFile::~CFile() {	Close();}
开发者ID:BGCX261,项目名称:znc-msvc-svn-to-git,代码行数:3,


示例16: Close

COMXVideo::~COMXVideo(){  Close();}
开发者ID:BenxiangGe,项目名称:boxeebox-xbmc,代码行数:4,


示例17: Close

Log::~Log(){    Close();}
开发者ID:Tithand,项目名称:TER-Server,代码行数:4,


示例18: Close

bool GmInputStream::Open (const wxString & szIStream){	Close ();	m_szFileName = szIStream;	return m_In.Open (szIStream);}
开发者ID:tanganam,项目名称:gimu,代码行数:6,


示例19: Close

MciPlayer::~MciPlayer(){    Close();    DestroyWindow(_wnd);}
开发者ID:BeyondEngine,项目名称:BeyondEngine,代码行数:5,


示例20: Close

CetonChannel::~CetonChannel(void){    Close();}
开发者ID:garybuhrmaster,项目名称:mythtv,代码行数:4,


示例21: Close

void CGUIDialogSmartPlaylistEditor::OnCancel(){  m_cancelled = true;  Close();}
开发者ID:AndyPeterman,项目名称:mrmc,代码行数:5,


示例22: tReadEntry

int tReadEntry(){  int fd, retR, retC;  struct VFS_Dir_Entry dirEntry;  retC = Create_Directory("/d/basic11d");  if (retC < 0)    return -1;  retC = Create_Directory("/d/basic11d/d1");  if (retC < 0)    return -1;  retC = Create_Directory("/d/basic11d/d2");  if (retC < 0)    return -1;  fd = Open("/d/basic11d/f1", O_CREATE);  if (fd < 0)    return -1;  Close(fd);Print("all file/dir created./n");  fd = Open_Directory("/d/basic11d");  if (fd < 0)    return -1;  retR = Read_Entry(fd, &dirEntry);Print("read 1 entry./n");  if ((retR < 0) ||      (strncmp(dirEntry.name, "d1", 2) != 0) ||       (! dirEntry.stats.isDirectory))    return -1;  retR = Read_Entry(fd, &dirEntry);Print("read 2 entry./n");  if ((retR < 0) ||      (strncmp(dirEntry.name, "d2", 2) != 0) ||       (! dirEntry.stats.isDirectory))    return -1;  retR = Read_Entry(fd, &dirEntry);Print("read 3 entry./n");  if ((retR < 0) ||      (strncmp(dirEntry.name, "f1", 2) != 0) ||       (dirEntry.stats.isDirectory))    return -1;    Close(fd);  fd = Open_Directory("/d/basic11d");  if (fd < 0)    return -1;Print("opened basic11d./n");  retR = Seek(fd, 2);  if (retR < 0)  {   	Print("failed seek./n");	 return -1;  }  retR = Read_Entry(fd, &dirEntry);Print("read no2 entry./n");  if ((retR < 0) ||      (strncmp(dirEntry.name, "f1", 2) != 0) ||       (dirEntry.stats.isDirectory))    return -1;    Close(fd);  Delete("/d/basic11d/d1");  Delete("/d/basic11d/d2");  Delete("/d/basic11d/f1");  Delete("/d/basic11d");	Print("all files deleted./n");  return 1;}
开发者ID:wyl0706,项目名称:GEEKOS,代码行数:86,


示例23: Close

ArmPort::~ArmPort(){	Close();}
开发者ID:RomualdoGobbo,项目名称:armapi,代码行数:4,


示例24: tFiveMegs

int tFiveMegs(){  int fd, retW, retR, retS;  int i,j;  char buffer[1000], buffer2[1000];  int ret = 1;  for (i = 0; i < 1000; i++ )    buffer[i] = buffer2[i] = i & 0xff;  fd = Open("/d/bigfile", O_CREATE|O_WRITE);  if (fd < 0)    return -1;  Print("Writing in first 5MB at random ... /n");  for (i = 0; i < 50; i++ )    {      retS = Seek(fd, 100000 * i);      if (retS < 0 )	{	  ret = -1;	  break;	}      retW = Write( fd, buffer, 1000);      if (retW != 1000)	{	  ret = -1;	  break;	}      Print(" %d/n", i);    }  Close(fd);  if (ret < 0)    {      Delete("/d/bigfile");      return -1;    }  //while(1);  Print("--------------------------------/n");  Print("Reading back from first 5MB ... /n");  fd = Open("/d/bigfile", O_READ);  if (fd < 0)    return -1;  for (i = 0; i < 50; i++ )    {      retS = Seek(fd, 100000 * i);Print("&&&&&&&&&&&&&&/n");      if (retS < 0 )	{	  ret = -1;	  break;	}      retR = Read( fd, buffer, 1000);      if (retR != 1000)	{	  ret = -1;	  break;	}      for (j = 0; j < 1000; j++ )	{	  if (buffer[j] != buffer2[j])	    {		Print("j:%d, buf1:%d, buf2:%d/n", j, buffer[j], buffer2[j]);	      ret = -1;	      break;	    }	}      Print(" %d", i);    }  Close(fd);  Delete("/d/bigfile");  return ret;}
开发者ID:wyl0706,项目名称:GEEKOS,代码行数:87,


示例25: Close

void SjArtEditor::OnActivate(wxActivateEvent& event){	if( !event.GetActive() && m_stay == 0 )		Close();}
开发者ID:antonivich,项目名称:Silverjuke,代码行数:5,


示例26: tWriteReread

int tWriteReread(int howManyKBs, char const * fileName){  int fd, retW, retR;  int i, j;  char buffer[100], buffer2[100];  int ret = 1;  for (j = 0; j < 100; j++ )    buffer[j] = j;  fd = Open(fileName, O_CREATE|O_WRITE);  if (fd < 0)    return -1;  for (i = 0; i < (howManyKBs * 10); i++ )    {      retW = Write( fd, buffer, 100);      if (retW != 100)	{	  ret = -1;	  break;	}      if (i%50 == 0)	Print(" %d", i);    }  Close(fd);  //while(1);  if (ret != -1)    {      fd = Open(fileName, O_READ);      if (fd < 0)	return -1;      for (i = 0; i < (howManyKBs * 10); i++ )	{	  retR = Read( fd, buffer2, 100);	  if (retR != 100)	    {	      ret = -1;	      break;	    }	  for(j = 0; j < 100; j++)	    {	      if (buffer2[j] != j)		{		Print("buffer2[j-1]=%d, j-1=%d/n", buffer2[j-1], j-1);		Print("unequal:j=%d, buf2[j]=%d/n", j, buffer2[j]);		for(j = 0; j < 100; j++)			Print("buf2[%d]=%d/n", j, buffer2[j]);		  ret = -1;		  break;		}	    }	  	  if (ret < 0 )	    break;	  if (i%50 == 0)	    Print(" %d", i);	}      Close(fd);      Delete(fileName);    }  return ret;}
开发者ID:wyl0706,项目名称:GEEKOS,代码行数:70,


示例27: WXUNUSED

void BrowserFrame::OnClose(wxCommandEvent & WXUNUSED(event)){   Close();}
开发者ID:GYGit,项目名称:Audacity,代码行数:4,


示例28: Close

void PostProcessingConfigDiag::Event_ClickClose(wxCommandEvent&){  Close();}
开发者ID:Antidote,项目名称:dolphin,代码行数:4,



注:本文中的Close函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ CloseAll函数代码示例
C++ CloneString函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。