📄 step2.cpp
字号:
/*
* Step9:
* Program exit by catching signal and killing the main thread.
*/
#include <iostream.h>
#include <stdlib.h>
#include <windows.h>
#include "Pi2API.h"
#include "TestAPI.h"
void MessageHandler()
{
MSG tMsg;
while( GetMessage( &tMsg, NULL, 0, 0 ) )
{
TranslateMessage( &tMsg );
DispatchMessage( &tMsg );
};
// cout << "Signal #" << iSignal << endl;
// PIThread_terminate( PIThread_getMain(), 37 );
}
int iRet;
void Step2( PIDB * )
{
// signal( SIGTERM, Handler );
// signal( SIGINT, Handler );
// iRet = 0;
// for(; !iDie;) {}
// iRet = -1;
MessageHandler();
}
int main()
{
if ( PIProgram_enter( "dummy", PIPROGRAM_VERSION_1_0, Step2 ) )
{
cout << "Program_enter() failed." << endl;
FAILED(99);
exit( 1 );
};
OK;
return iRet;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -