home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / powergui / shipapp / appstat / appstat.cpp next >
Text File  |  1996-10-29  |  817b  |  32 lines

  1. //************************************************************
  2. // Packaging and Performance - Using Static Object Functions 
  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 <ireslib.hpp>
  9. #include "appstat.hpp"
  10.  
  11. // Define static instance of AppStatics.
  12. AppStatics appStatics;
  13.  
  14. // Initialize AppStatics object pointer
  15. IDynamicLinkLibrary* AppStatics::engDLL = 0;
  16.  
  17. // Destructor to close the DLL.
  18. AppStatics::~AppStatics ( )
  19. {
  20.   if(engDLL != 0)
  21.     delete engDLL;
  22. }
  23.  
  24. // Static accessor for the DLL.
  25. IDynamicLinkLibrary& AppStatics :: englishDLL( )
  26. {
  27.    if(!engDLL)
  28.      engDLL = new IDynamicLinkLibrary("myeng");
  29.    return *engDLL;
  30. }
  31.  
  32.