home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / powergui / getstart / nonport / nonport.cpp < prev   
Encoding:
C/C++ Source or Header  |  1996-10-29  |  1.0 KB  |  44 lines

  1. //*********************************************************
  2. // Getting Started - Using Platform-Specific Code
  3. //
  4. // Copyright (C) 1994, Law, Leong, Love, Olson, Tsuji.
  5. // Copyright (c) 1997 John Wiley & Sons, Inc. 
  6. // All Rights Reserved.
  7. //*********************************************************
  8. #include <ibase.hpp>    // For IC_WIN or IC_PM.
  9.  
  10. #ifdef IC_PM
  11. #define INCL_WINDIALOGS
  12. #include <os2.h>
  13. #else
  14. #include <windows.h>
  15. #endif
  16.  
  17. #include <imsgbox.hpp>
  18. #include <istring.hpp>
  19. #include <iwindow.hpp>
  20.  
  21. void main ( )
  22. {
  23.   // Call a platform-specific API and display a
  24.   // platform-specific message.
  25. #ifdef IC_PM
  26.   WinAlarm( IWindow::desktopWindow()->handle(), WA_NOTE );
  27.   IString 
  28.     msg( "This is an OS/2 application." );
  29. #else
  30.   Beep( 100, 100 );
  31.   IString 
  32.     msg( "This is a Windows application." );
  33. #endif
  34.  
  35.   IMessageBox
  36.     msgBox( 0 );
  37.   msgBox
  38.    .setTitle( "Which Platform?" )
  39.    .show( msg,
  40.           IMessageBox::informationIcon
  41.            | IMessageBox::okButton
  42.            | IMessageBox::moveable );
  43. }
  44.