step8.cpp
来自「mini http server,可以集成嵌入到程序中,实现简单的web功能」· C++ 代码 · 共 51 行
CPP
51 行
/*
* Step 7: Initialize the program database functionality and
* write a simple hello world.
*/
#include <iostream.h>
#include <stdlib.h>
#include "Pi2API.h"
int iRet;
void Step8( PIDB *pDB )
{
iRet = -1;
cout << "Program running on " << PIPlatform_getDescription() << endl;
cout << endl;
PIConfig *pConfigDB = 0;
const char *pFile = "./Step8.cnf";
if ( PIConfig_loadConfigurationFile( pDB, pFile, &pConfigDB ) )
{
cerr << "Unable to load configuration file: '" << pFile
<< "'" << endl;
return;
};
const PIClass *pClass = PIClass_load( pDB, pConfigDB, "Step8" );
if ( !pClass )
{
cerr << "Failed to load class:-" << endl;
PILog_writeDiagnostics( pDB, PILOG_ALL, 0 );
};
iRet = 0;
}
/* ---
--- */
int main()
{
if ( PIProgram_enter( "dummy", PIPROGRAM_VERSION_1_0, Step8 ) )
{
cerr << "Program_enter() failed." << endl;
exit( 1 );
};
return iRet;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?