现在的位置: 首页 > 综合 > 正文

App::ExitInstance 测试

2013年10月14日 ⁄ 综合 ⁄ 共 684字 ⁄ 字号 评论关闭
/* Count is a global variable, so it will be remembered between calls */
static int Count = 1;
void MyExit()
{
mexPrintf("MyExit() called!\n");
/* Do cleanup here ... */
return;
}

void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
mexAtExit(&MyExit); /* Register MyExit() to run when MEX??function is cleared */
mexPrintf("Count=%d\n", Count);
Count++; /* Increment Count */
return;
}

/////////////////////////////
CRemember2App theApp;
int CRemember2App::ExitInstance() 
{
	// TODO: Add your specialized code here and/or call the base class
	mexPrintf("App::ExitInstance() called!\n");
	return CWinApp::ExitInstance();
}
/////////////////////////////

>> remember2
Count=1
>> remember2
Count=2
>> clear remember2
MyExit() called!
App::ExitInstance() called!
>> 

抱歉!评论已关闭.