home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / powergui / reslib / procaddr / procaddr.cpp < prev   
Encoding:
C/C++ Source or Header  |  1996-10-29  |  709 b   |  29 lines

  1. /************************************************************
  2. / Using Resources - Loading a Function Address
  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 <iprocadr.hpp>
  9. #include <stream.h>
  10.  
  11. typedef int (*IntReturningInt)( int );
  12.  
  13. void main( )
  14. {
  15.   IProcedureAddress<IntReturningInt> isValid( "isValid", "MYENG" );
  16.  
  17.   int checkIt=0;
  18.   int valid=0;
  19.  
  20.   while(checkIt!=99)
  21.   {
  22.    cout << "Enter a number (99 to quit)" << "\n";
  23.    cin >> checkIt;
  24.    valid = isValid(checkIt );
  25.    cout << "isValid() returned " << valid << "\n";
  26.   }
  27. }
  28.  
  29.