home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / samples / ioc / lancelot / lancelot.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  3.2 KB  |  73 lines

  1. /******************************************************************************
  2. * .FILE:         lancelot.cpp                                                 *
  3. *                                                                             *
  4. * .DESCRIPTION:  Lancelot Sample Program:              Class Implementation   *
  5. *                                                                             *
  6. * .CLASSES:      None                                                         *
  7. *                                                                             *
  8. * .COPYRIGHT:                                                                 *
  9. *                                                                             *
  10. * .DISCLAIMER:                                                                *
  11. *                                                                             *
  12. * .NOTE: WE RECOMMEND USING A FIXED SPACE FONT TO LOOK AT THE SOURCE          *
  13. *                                                                             *
  14. ******************************************************************************/
  15.  
  16. #ifndef _IBASE_                         //Make sure ibase.hpp is included
  17.   #include <ibase.hpp>                  //  since that is where IC_<environ>
  18. #endif                                  //  is defined.
  19. #include <iapp.hpp>
  20. #include <ithread.hpp>
  21. #include <imsgbox.hpp>
  22. #include <icoordsy.hpp>
  23. #include "lmainwin.hpp"
  24.  
  25. int main()
  26. {
  27.   ICoordinateSystem::setApplicationOrientation(
  28.           ICoordinateSystem::originLowerLeft );
  29.  
  30. /*-----------------------------------------------------------------------------
  31. | Set the default IHelpWindow style for the entire application.               |
  32. | If USE_IPF is defined, use IPF help.  Otherwise, use Windows RTF help.      |
  33. -----------------------------------------------------------------------------*/
  34.    #if (defined IC_WIN && defined USE_IPF)
  35.    IHelpWindow::setDefaultStyle( IHelpWindow::defaultStyle()
  36.                                  | IHelpWindow::ipfCompatible );
  37.    #endif
  38.  
  39. /*-----------------------------------------------------------------------------
  40. | Set the default IToolBarButton styles for the entire application.           |
  41. -----------------------------------------------------------------------------*/
  42.    #ifndef IC_MOTIF
  43.    IToolBarButton::setDefaultStyle(
  44.      IToolBarButton::classDefaultStyle
  45.      &~IToolBarButton::standardFormat );
  46.    #endif
  47.  
  48. /*-----------------------------------------------------------------------------
  49. | Test if .INI files can be accessed from the current directory.              |
  50. |   If they can't, tell the user and end the application.                     |
  51. | Create the main window for the application                                  |
  52. | Start the event processing loop                                             |
  53. -----------------------------------------------------------------------------*/
  54.    try
  55.    {
  56.       IProfile testing( "lsaveqry.ini" );
  57.    }
  58.    catch(...)
  59.    {
  60.       IMessageBox
  61.          msgBox( IWindow::desktopWindow() );
  62.       msgBox.show( STR_NO_DB_ACCESS, IMessageBox::catastrophic );
  63.       return 2;
  64.    }
  65.  
  66.    LMainWindow mainWindow;
  67.  
  68.    IApplication::current().run();
  69.  
  70.    return 0;
  71. }
  72.  
  73.