step2.cpp

来自「mini http server,可以集成嵌入到程序中,实现简单的web功能」· C++ 代码 · 共 51 行

CPP
51
字号

/*
 * 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 + =
减小字号Ctrl + -
显示快捷键?