home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / smarts / dts / main.cpp < prev    next >
Encoding:
Text File  |  1996-02-21  |  2.1 KB  |  87 lines

  1. --------------------------------------------------------------------------------
  2. --
  3. -- COPYRIGHT:
  4. --   IBM WorkFrame - Project Smarts
  5. --   (C) Copyright International Business Machines Corporation 1996
  6. --   Licensed Material - Program-Property of IBM - All Rights Reserved.
  7. --   US Government Users Restricted Rights - Use, duplication, or disclosure
  8. --   restricted by GSA ADP Schedule Contract with IBM Corp.
  9. --
  10. --------------------------------------------------------------------------------
  11. <include prologcp.tde>
  12.  
  13. #include <stdio.h>
  14. <if ($DSOM$)>
  15.  
  16. #include <somd.hh>
  17. </if>
  18.  
  19. <if ($DSOM$)>
  20. #pragma SOMNoDataDirect(on)
  21. </if>
  22. <repeat HEADER_NAME>
  23. #include "$HEADER_NAME$.hh"
  24. </repeat>
  25. <if ($DSOM$)>
  26. #pragma SOMNoDataDirect(pop)
  27. </if>
  28.  
  29. int main(int argc, char *argv[])
  30. {
  31. <if ($DSOM$)>
  32.     SOMDServer  *server;
  33. </if>
  34.     Environment *__SOMEnv;   // This is a special name, don't change it.
  35.  
  36. //
  37. // Create SOM environment
  38. //
  39.     __SOMEnv = SOM_CreateLocalEnvironment();
  40.  
  41. <if ($DSOM$)>
  42. //
  43. // Initialize DSOM run-time environment.
  44. //
  45.     SOMD_Init(__SOMEnv);
  46.  
  47. //
  48. // Get a handle on a proxy to the server named '$SOM_SERVER$'
  49. //
  50.     server = SOMD_ObjectMgr->somdFindServerByName("$SOM_SERVER$");
  51.  
  52.     if (server)
  53.     {
  54.  
  55.      //======================================================
  56.      // Code to create and manipulate remote client object.
  57.      //======================================================
  58.  
  59.     }
  60.  
  61. //
  62. // Resources should be relinquished when finished dealing with remote object.
  63. // If you wish to destroy both the local proxy and remote object uncomment
  64. // the two source lines below.
  65. //
  66. // if ( NameOfRemoteObject )
  67. //    SOMD_ObjectMgr->somdDestroyObject( NameofRemoteObject );
  68. //
  69. // or, if you wish to do not want to destroy the remote object, but only
  70. // wish to delete the local proxy, uncomment the two source lines below.
  71. //
  72. // if ( NameOfRemoteObject )
  73. //    SOMD_ObjectMgr->somdReleaseObject( NameOfRemoteObject );
  74. //
  75.  
  76. //
  77. // Free up resources used by DSOM run-time environment
  78. //
  79.  
  80.     SOMD_Uninit(__SOMEnv);
  81. </if>
  82.  
  83.     SOM_DestroyLocalEnvironment(__SOMEnv);
  84.  
  85.     return(0);
  86. }
  87.