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

C++ OnExit函数代码示例

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

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



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

示例1: _T

bool EViacamApp::OnInit()
{     	
	// Call default behaviour
	if (!wxApp::OnInit()) return false;

/* ////@begin EViacamApp initialisation */
	// Remove the comment markers above and below this block
	// to make permanent changes to the code.

#if wxUSE_XPM
	wxImage::AddHandler(new wxXPMHandler);
#endif
#if wxUSE_LIBPNG
	wxImage::AddHandler(new wxPNGHandler);
#endif
#if wxUSE_LIBJPEG
	wxImage::AddHandler(new wxJPEGHandler);
#endif
#if wxUSE_GIF
	wxImage::AddHandler(new wxGIFHandler);
#endif		
/* ////@end EViacamApp initialisation */

// Set up globals
#ifndef NDEBUG
	// Assume project runs from src/ 
	eviacam::SetDataDir(wxGetCwd() + _T("/../doc/"));
#else
	eviacam::SetDataDir(wxStandardPaths::Get().GetDataDir());
#endif
	
	// Initialize sockets support
	// Note: (Workaround for implementation limitation for wxWidgets up to 2.5.x) 
	// If you want to use sockets or derived classes such as wxFTP in a secondary 
	// thread, call wxSocketBase::Initialize() (undocumented) from the main thread 
	// before creating any sockets - in wxApp::OnInit for example. 
	// See http://wiki.wxwidgets.org/wiki.pl?WxSocket or 
	// http://www.litwindow.com/knowhow/knowhow.html for more details.
	wxSocketBase::Initialize();

	m_pController= new CViacamController();
	assert (m_pController);
	if (!m_pController->Initialize()) 
	{
		OnExit();
		return false;
	}
	else return true;
}
开发者ID:rkvsraman,项目名称:eviacam,代码行数:49,代码来源:eviacamapp.cpp


示例2: DllMain

BOOL APIENTRY DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
    switch (dwReason)
    {
        case DLL_PROCESS_ATTACH:
            OnStartup();
            break;

        case DLL_PROCESS_DETACH:
            OnExit();
            break;
    }

    return TRUE;
}
开发者ID:GeraintPratten,项目名称:lalsuite,代码行数:15,代码来源:exchndl64.c


示例3: OnExit

/// Handles an entity leaving the Trigger area.
void RPG_Trigger::ProcessExit(VisBaseEntity_cl* entity)
{
  // check if this entity is in inside the trigger.
  int foundIndex = m_insideEntities.Find(entity);

  if(foundIndex > -1)
  {
    m_insideEntities.RemoveAt(foundIndex);

    OnExit(entity);
    if(m_onExitSource)
      m_onExitSource->TriggerAllTargets();
    TriggerScriptEvent("OnExit", "*o", entity);
  }
}
开发者ID:Bewolf2,项目名称:projectanarchy,代码行数:16,代码来源:Trigger.cpp


示例4: OnExit

void KG3DAnimationTagContainer::Clear()
{
	OnExit();

	SAFE_RELEASE(m_pClip);
    for (size_t i = 0; i < m_vecTags.size(); i++)
    {
        SAFE_DELETE(m_vecTags[i].pTag)
    }

	m_vecTags.clear();
    m_szAnimationName[0] = '\0';
    m_bModifyFlag = FALSE;
	m_IsLoaded = FALSE;
}
开发者ID:1suming,项目名称:pap2,代码行数:15,代码来源:KG3DAnimationTagContainer.cpp


示例5: OnExit

// Handles left click in main menu
void CApp::MenuClick(int mX, int mY)
{
    if(mY > 157 && mY < 213 && mX > 204 && mX < 398)
    {
        AIenabled = true;
        GameState = GAME_STATE_RUNNING;
    }
    if(mY > 273 && mY < 329 && mX > 204 && mX < 398)
    {
        AIenabled = false;
        GameState = GAME_STATE_RUNNING;
    }
    if(mY > 410 && mY < 466 && mX > 204 && mX < 398)
        OnExit();
}
开发者ID:Fenixp,项目名称:Tic-Tac-Toe-SDL,代码行数:16,代码来源:CApp.cpp


示例6: main

//------------------------------------------------------------  main()
//
int main(int argc, char **argv)
{		
	
	if ( !(subject_name = Parser(argc, argv)) ) 		// Parsea la linea de comandos: 	parser.c
		exit (1);			
	
	OnInit();						//Inicializa todo lo inicializable: sdlgl_control.h	
	
	ExperimentSetup(); 				//Configura el experimento
	MainLoop();						//Lanza el experimento propiamente dicho
	ExperimentSave();				//Salva los resultados en un archivo
	
	OnExit();						//Cierra limpiamente todico: sdlgl_control.h
	
	return APPSUCCESS;
}
开发者ID:jorjuato,项目名称:IORExperiments,代码行数:18,代码来源:main.c


示例7: OnStartup

void CThread::Action()
{
  try
  {
    OnStartup();
  }
  catch (const XbmcCommons::UncheckedException &e)
  {
    e.LogThrowMessage("OnStartup");
    if (IsAutoDelete())
      return;
  }
  catch (...)
  {
    LOG(LOGERROR, "%s - thread %s, Unhandled exception caught in thread startup, aborting. auto delete: %d", __FUNCTION__, m_ThreadName.c_str(), IsAutoDelete());
    if (IsAutoDelete())
      return;
  }

  try
  {
    Process();
  }
  catch (const XbmcCommons::UncheckedException &e)
  {
    e.LogThrowMessage("Process");
  }
  catch (...)
  {
    LOG(LOGERROR, "%s - thread %s, Unhandled exception caught in thread process, aborting. auto delete: %d", __FUNCTION__, m_ThreadName.c_str(), IsAutoDelete());
  }

  try
  {
    OnExit();
  }
  catch (const XbmcCommons::UncheckedException &e)
  {
    e.LogThrowMessage("OnExit");
  }
  catch (...)
  {
    LOG(LOGERROR, "%s - thread %s, Unhandled exception caught in thread OnExit, aborting. auto delete: %d", __FUNCTION__, m_ThreadName.c_str(), IsAutoDelete());
  }
}
开发者ID:0xheart0,项目名称:xbmc,代码行数:45,代码来源:Thread.cpp


示例8: switch

void CEvent::OnEvent(SDL_Event* Event)
{
  switch(Event->type) {
    case SDL_QUIT: 
      OnExit();			//funzione definita in game.h e implementata in game.cpp che setta a false la variabile running
      break;
      
    case SDL_KEYDOWN:
      if(Event->key.keysym.sym == SDLK_UP || Event->key.keysym.sym == SDLK_DOWN || Event->key.keysym.sym == SDLK_LEFT || Event->key.keysym.sym == SDLK_RIGHT )
	ArrowPressed(Event->key.keysym.sym);
      break;
    
    case SDL_KEYUP:
      if(Event->key.keysym.sym == SDLK_UP || Event->key.keysym.sym == SDLK_DOWN || Event->key.keysym.sym == SDLK_LEFT || Event->key.keysym.sym == SDLK_RIGHT )
	ArrowReleased();
      break;
  }
}
开发者ID:elrod,项目名称:moonlander-clone,代码行数:18,代码来源:Cevent.cpp


示例9: wxCHECK_RET

void wxEventLoop::Exit(int rc)
{
    wxCHECK_RET( IsRunning(), _T("can't call Exit() if not running") );

    m_exitcode = rc;
    m_shouldExit = true;

    OnExit();

    // all we have to do to exit from the loop is to (maybe) wake it up so that
    // it can notice that Exit() had been called
    //
    // in particular, we do *not* use PostQuitMessage() here because we're not
    // sure that WM_QUIT is going to be processed by the correct event loop: it
    // is possible that another one is started before this one has a chance to
    // process WM_QUIT
    ::PostMessage(NULL, WM_NULL, 0, 0);
}
开发者ID:HackLinux,项目名称:chandler-1,代码行数:18,代码来源:evtloop.cpp


示例10: while

int wxQtEventLoopBase::DoRun()
{
    int ret;

    // This is placed inside of a loop to take into account nested event loops
    while ( !m_shouldExit )
    {
        // This will print Qt warnins if app already started:
        // "QCoreApplication::exec: The event loop is already running"
        // TODO: check the loopLevel (nested) like in wxGTK
        ret = QCoreApplication::exec();
        // process pending events (if exec was started previously)
        // TODO: use a real new QEventLoop() ?
        QCoreApplication::processEvents();
    }
    OnExit();
    return ret;
}
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:18,代码来源:evtloop.cpp


示例11: wxASSERT_MSG

void wxThread::Exit(ExitCode status)
{
    wxASSERT_MSG( This() == this,
                  _T("wxThread::Exit() can only be called in the context of the same thread") );

    if ( m_isDetached )
    {
        // from the moment we call OnExit(), the main program may terminate at
        // any moment, so mark this thread as being already in process of being
        // deleted or wxThreadModule::OnExit() will try to delete it again
        ScheduleThreadForDeletion();
    }

    // don't enter m_critsect before calling OnExit() because the user code
    // might deadlock if, for example, it signals a condition in OnExit() (a
    // common case) while the main thread calls any of functions entering
    // m_critsect on us (almost all of them do)
    OnExit();

    // delete C++ thread object if this is a detached thread - user is
    // responsible for doing this for joinable ones
    if ( m_isDetached )
    {
        // FIXME I'm feeling bad about it - what if another thread function is
        //       called (in another thread context) now? It will try to access
        //       half destroyed object which will probably result in something
        //       very bad - but we can't protect this by a crit section unless
        //       we make it a global object, but this would mean that we can
        //       only call one thread function at a time :-(
        DeleteThread(this);
        pthread_setspecific(gs_keySelf, 0);
    }
    else
    {
        m_critsect.Enter();
        m_internal->SetState(STATE_EXITED);
        m_critsect.Leave();
    }

    // terminate the thread (pthread_exit() never returns)
    pthread_exit(status);

    wxFAIL_MSG(_T("pthread_exit() failed"));
}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:44,代码来源:threadpsx.cpp


示例12: switch

void cEvent::OnKeyDown(SDLKey sym, SDLMod mod, Uint16 unicode)
{
    switch (sym)
    {
        case SDLK_ESCAPE:
        {
            OnExit();
            break;
        }
        case SDLK_RETURN:
        {
            if ((SDLK_RETURN) && ((mod & KMOD_ALT)))
            {
                sysToggleFullScreen();
            }
            break;
        }
    }
}
开发者ID:sdlSokoban,项目名称:sdlSokoban,代码行数:19,代码来源:cEvent.cpp


示例13: ScheduleExit

    // sets the "should exit" flag and wakes up the loop so that it terminates
    // soon
    void ScheduleExit( int rc = 0 )
    {
        wxCHECK_RET( IsInsideRun(), wxT("can't call ScheduleExit() if not running") );

        m_exitcode = rc;
        m_shouldExit = true;

        OnExit();

        // all we have to do to exit from the loop is to (maybe) wake it up so that
        // it can notice that Exit() had been called
        //
        // in particular, do *not* use here calls such as PostQuitMessage() (under
        // MSW) which terminate the current event loop here because we're not sure
        // that it is going to be processed by the correct event loop: it would be
        // possible that another one is started and terminated by mistake if we do
        // this
        WakeUp();
    }
开发者ID:BTR1,项目名称:kicad-source-mirror,代码行数:21,代码来源:dialog_shim.cpp


示例14: UpperLeft

void CreditsWnd::Render() {
    if (!m_render)
        return;
    GG::Pt ul = UpperLeft(), lr = LowerRight();
    if (m_display_list_id == 0) {
        // compile credits
        m_display_list_id = glGenLists(1);
        glNewList(m_display_list_id, GL_COMPILE);
        DrawCredits(ul.x + m_cx, ul.y + m_cy, ul.x + m_cx + m_cw, ul.y + m_cy + m_ch, 255);
        glEndList();
    }
    //time passed
    int ticks_delta = GG::GUI::GetGUI()->Ticks() - m_start_time + m_scroll_offset;

    //draw background
    GG::FlatRectangle(ul, lr, GG::FloatClr(0.0f, 0.0f, 0.0f, 0.5f), GG::CLR_ZERO, 0);

    glPushAttrib(GL_ALL_ATTRIB_BITS);
    glPushMatrix();

    // define clip area
    glEnable(GL_SCISSOR_TEST);
    glScissor(Value(ul.x + m_cx), Value(GG::GUI::GetGUI()->AppHeight() - lr.y), m_cw, m_ch);

    // move credits
    glTranslatef(0, m_co - ticks_delta/40, 0);

    if (m_display_list_id != 0) {
        // draw credits using prepared display list
        // !!! in order for the display list to be valid, the font object (m_font) may not be destroyed !!!
        glCallList(m_display_list_id);
    } else {
        // draw credits directly
        DrawCredits(ul.x + m_cx, ul.y + m_cy, ul.x + m_cx + m_cw, ul.y + m_cy + m_ch, 255);
    }

    glPopMatrix();
    glPopAttrib();

    //check if we are done
    if (m_credits_height + m_ch < m_co + ticks_delta/40)
        OnExit();
}
开发者ID:mel-odious,项目名称:freeorion,代码行数:43,代码来源:IntroScreen.cpp


示例15: switch

//---------------------------------------------------------------------------
void CApp::OnEvent(SDL_Event *Event) {

    switch(Event->type) {

        case SDL_QUIT: {
            OnExit();
            break;
        }

        case SDL_KEYDOWN: {
            Snake->onEvent(Event);
            break;
        }

        default: {
            break;
        }
    }
}
开发者ID:rokusjar,项目名称:Had,代码行数:20,代码来源:CApp_OnEvent.cpp


示例16: CTimer

bool CamuleGuiApp::OnInit()
{
	amuledlg = NULL;

	if ( !CamuleApp::OnInit() ) {
		return false;
	}

	// Create the Core timer
	core_timer = new CTimer(this,ID_CORE_TIMER_EVENT);
	if (!core_timer) {
		AddLogLineCS(_("Fatal Error: Failed to create Core Timer"));
		OnExit();
	}

	// Start the Core and Gui timers

	// Note: wxTimer can be off by more than 10% !!!
	// In addition to the systematic error introduced by wxTimer, we are losing
	// timer cycles due to high CPU load.  I've observed about 0.5% random loss of cycles under
	// low load, and more than 6% lost cycles with heavy download traffic and/or other tasks
	// in the system, such as a video player or a VMware virtual machine.
	// The upload queue process loop has now been rewritten to compensate for timer errors.
	// When adding functionality, assume that the timer is only approximately correct;
	// for measurements, always use the system clock [::GetTickCount()].
	core_timer->Start(CORE_TIMER_PERIOD);
	amuledlg->StartGuiTimer();

#ifdef __WXMAC__
	// This tells the OS to notice the ed2kHelperScript.app inside aMule.app.
	// ed2kHelperScript.app describes itself (Info.plist) as handling ed2k URLs.
	// So, from then on the OS will know to pass ed2k URLs to the helper app.
	CFURLRef ed2kHelperUrl = CFBundleCopyAuxiliaryExecutableURL(
		CFBundleGetMainBundle(), CFSTR("ed2kHelperScript.app"));
	if (ed2kHelperUrl) {
		LSRegisterURL(ed2kHelperUrl, true);
		CFRelease(ed2kHelperUrl);
	}
#endif

	return true;
}
开发者ID:javaforfun,项目名称:amule-dlp,代码行数:42,代码来源:amule-gui.cpp


示例17: switch

void Game::events(SDL_Event* event)
{
     switch(event->type)
     {
        case SDL_KEYDOWN: {
            OnKeyDown(event->key.keysym.sym,event->key.keysym.mod,event->key.keysym.unicode);
            break;
        }

        case SDL_KEYUP: {
            OnKeyUp(event->key.keysym.sym,event->key.keysym.mod,event->key.keysym.unicode);
            break;
        }
        case SDL_QUIT:{
            OnExit();
            break;

        }
     }
}
开发者ID:Fahv,项目名称:Snake,代码行数:20,代码来源:Game.cpp


示例18: OnExit

KX_BlenderMaterial::~KX_BlenderMaterial()
{
	Material *ma = mMaterial->material;
	// Restore Blender material data
	ma->r = mSavedData.r;
	ma->g = mSavedData.g;
	ma->b = mSavedData.b;
	ma->alpha = mSavedData.a;
	ma->specr = mSavedData.specr;
	ma->specg = mSavedData.specg;
	ma->specb = mSavedData.specb;
	ma->spec = mSavedData.spec;
	ma->ref = mSavedData.ref;
	ma->har = mSavedData.hardness;
	ma->emit = mSavedData.emit;

	// cleanup work
	if (mConstructed)
		// clean only if material was actually used
		OnExit();
}
开发者ID:mgschwan,项目名称:blensor,代码行数:21,代码来源:KX_BlenderMaterial.cpp


示例19: WXUNUSED

void wxApp::OnEndSession(wxCloseEvent& WXUNUSED(event))
{
    // Windows will terminate the process soon after we return from
    // WM_ENDSESSION handler or when we delete our last window, so make sure we
    // at least execute our cleanup code before

    // prevent the window from being destroyed when the corresponding wxTLW is
    // destroyed: this will result in a leak of a HWND, of course, but who
    // cares when the process is being killed anyhow
    if ( !wxTopLevelWindows.empty() )
        wxTopLevelWindows[0]->SetHWND(0);

    const int rc = OnExit();

    wxEntryCleanup();

    // calling exit() instead of ExitProcess() or not doing anything at all and
    // being killed by Windows has the advantage of executing the dtors of
    // global objects
    exit(rc);
}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:21,代码来源:app.cpp


示例20: switch

void CDlgDriveEconomy::OnLButtonUp(UINT nFlags, CPoint point) 
{
	for(int i=0;i<enCtrCount;i++)
	{
		if(m_Item[i].nState==BTN_STATE_DOWN)
		{
			m_Item[i].nState = BTN_STATE_NORMAL;
			
			switch( i )
			{
			case 0:
				{
				}
				break;
			case 1:
				{
					CDlgOilConsum dlg;
					dlg.DoModal();
				}
				break;
			case 2:
				{
					CDlgDriveEconomySetting dlg;
					dlg.DoModal();
				}
				break;
			case 3: 
				OnExit();
				break;
			default:
				break;
			}
		}
	}
	
	Invalidate();
	ReleaseCapture();
	CDialogBase::OnLButtonUp(nFlags, point);
}
开发者ID:gaojihao,项目名称:7520Inspru,代码行数:39,代码来源:DlgDriveEconomy.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ OnHelp函数代码示例发布时间:2022-05-30
下一篇:
C++ OnEvent函数代码示例发布时间: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