Jump to content

PMApp: Difference between revisions

From EDM2
Ak120 (talk | contribs)
mNo edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Description==
The PMApp class is the main class for a [[PM++]] application and contains the command line parameters, a PMAnchorBlock and a PMMessageQueue, and a few functions to process the window  messages of the application's main thread.   
The PMApp
class is the main class for a PM++ application and contains the command
line parameters, a PMAnchorBlock and a PMMessageQueue, and a few
functions to process the window  messages of the application's main
thread.   


==Example==
==Example==
With these classes the main() function of a PM++ application can be as simple as:
With these classes the main() function of a PM++ application can be as simple as:
<code>
PMApp *App;
int main (int argc,char* argv[])
{
  PMAnchorBlock ab;
  PMMessageQueue mq;
  ab.init();
  mq.create(ab);
  App=new PMApp(ab,mq,argc,argv);
  PMWin * w=new PMWin(ab);
  w->createWin();
  App->run();


<PRE>
  w->destroyWin();
PMApp *App;
  mq.destroy();
  ab.uninit();
  return (0);
}
</code>


int main (int argc,char* argv[])
[[Category:PM++]]
{
PMAnchorBlock ab;
PMMessageQueue mq;
ab.init();
mq.create(ab);
App=new PMApp(ab,mq,argc,argv);
PMWin * w=new PMWin(ab);
w->createWin();
App->run();
w->destroyWin();
mq.destroy();
ab.uninit();
return (0);
}
</PRE>

Latest revision as of 23:41, 26 February 2017

The PMApp class is the main class for a PM++ application and contains the command line parameters, a PMAnchorBlock and a PMMessageQueue, and a few functions to process the window messages of the application's main thread.

Example

With these classes the main() function of a PM++ application can be as simple as:

PMApp *App;

int main (int argc,char* argv[])
{
  PMAnchorBlock ab;
  PMMessageQueue mq;
  ab.init();
  mq.create(ab);

  App=new PMApp(ab,mq,argc,argv);

  PMWin * w=new PMWin(ab);
  w->createWin();

  App->run();
  w->destroyWin();

  mq.destroy();
  ab.uninit();

  return (0);
}