home *** CD-ROM | disk | FTP | other *** search
/ PC Direkt 1995 March / PCD_395.iso / starview / wntmsci / german / svcinf.cx_ / SVCINF.CXX
Encoding:
C/C++ Source or Header  |  1994-01-21  |  1.8 KB  |  78 lines

  1. /*******************************************************************
  2. *  SVCINF.CXX
  3. *  (c) 1992-1994 STAR DIVISION
  4. *******************************************************************/
  5.  
  6. #include <sv.hxx>
  7. #include "svdde.hxx"
  8.  
  9. // --- class ClientWindow ------------------------------------------
  10.  
  11. class ClientWindow : public WorkWindow
  12. {
  13.     FixedText   aText;
  14.  
  15. public:
  16.                 ClientWindow();
  17.  
  18.     void        Resize();
  19.     void        Paint( const Rectangle& );
  20. };
  21.  
  22. // --- class ClientApp ---------------------------------------------
  23.  
  24. class ClientApp : public Application
  25. {
  26. public:
  27.     void Main( int, char* [] );
  28. };
  29.  
  30. // --- Instance of Class Application  ------------------------------
  31.  
  32. ClientApp aMyApp;
  33.  
  34. // --- ClientApp::Main() -------------------------------------------
  35.  
  36. void ClientApp::Main( int, char* [] )
  37. {
  38.     ClientWindow aWin;
  39.     aWin.SetText( String( "DDE Services" ) );
  40.     aWin.ChangeSizePixel( Size( 300, 200 ) );
  41.     aWin.Show();
  42.     Execute();
  43. }
  44.  
  45. // --- ClientWindow::ClientWindow() --------------------------------
  46.  
  47. ClientWindow::ClientWindow() :
  48.                 WorkWindow( NULL, WinBits( WB_APP | WB_STDWORK ) ),
  49.                 aText( this, WinBits( WB_CENTER ) )
  50. {
  51.     aText.Show();
  52. }
  53.  
  54. // --- ClientWindow::Resize() --------------------------------------
  55.  
  56. void ClientWindow::Resize()
  57. {
  58.     aText.ChangeOutputSizePixel( GetOutputSizePixel() );
  59. }
  60.  
  61. // --- ClientWindow::Paint() ---------------------------------------
  62.  
  63. void ClientWindow::Paint( const Rectangle& )
  64. {
  65.     String          s;
  66.     DdeServiceList aServices;
  67.     String*         p;
  68.  
  69.     for ( p = aServices.GetServices().First(); p ;
  70.           p = aServices.GetServices().Next() )
  71.     {
  72.         s += "\r\n";
  73.         s += *p;
  74.     }
  75.  
  76.     aText.SetText( s );
  77. }
  78.