Using PWLib

Brief examples.
Detailed tutorials will almost certainly not be forthcoming. However, at least giving you an indication on how to start an application would be usefull, so here is the infamous "Hello world!" program.
// hello.cxx

#include <ptlib.h>

class Hello : public PProcess
{
  PCLASSINFO(Hello, PProcess)
  public:
	void Main();
};

PCREATE_PROCESS(Hello)

void Hello::Main()
{
  cout << "Hello world!\n";
}

// End of hello.cxx

The CREATE_PROCESS macro actually defines the main() function and creates an instance of Hello. This assures that everything is initialised in the correct order. C++ does initialisation of global statics badly (and destruction is even worse), so try to put everything into your PProcess descedent rather than globals.

A GUI application is very similar but is descended off PApplication rather than PProcess, and would create a window as a descendent off the PMainWindow class.

Alphabetic index Hierarchy of classes



This page was generated with the help of DOC++.