home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / netds / rpc / cluuid / readme.txt < prev   
Encoding:
Text File  |  1996-01-17  |  4.4 KB  |  142 lines

  1. CLUUID
  2.  
  3.  
  4. The CLUUID program demonstrates how to supply multiple implementations of
  5. the remote procedure specified in the interface. It also demonstrates
  6. how the client selects among the implementations by providing a client 
  7. object uuid.
  8.  
  9. SUMMARY
  10. =======
  11.  
  12. The server calls RpcObjectSetType to associate a client object uuid with 
  13. the object uuid in the Object Registry Table. The server initializes a 
  14. manager entry point vector (manager epv) and then calls RpcRegisterIf to 
  15. associate the interface uuid and the object uuid with the manager epv in 
  16. the Interface Registry Table.
  17.  
  18. When the client makes a remote procedure call, the client object uuid is 
  19. mapped to the object uuid in the Object Registry Table. The resulting
  20. object uuid and the interface uuid are mapped to a manager entry point 
  21. vector in the Interface Registry Table.
  22.  
  23. By default, in this example, the server registers two implementations of 
  24. the "hello, world" function HelloProc and HelloProc2. The HelloProc2
  25. implementation is associated with the object uuid
  26. "11111111-1111-1111-1111-111111111111". When the client makes a procedure 
  27. call with a null uuid, the client's request is mapped to the original 
  28. HelloProc. When the client makes a procedure call with the client object 
  29. uuid "11111111-1111-1111-1111-11111111111", the client's request is mapped 
  30. to HelloProc2 (which prints the string in reverse).
  31.  
  32. FILES
  33. =====
  34.  
  35. The directory samples\rpc\cluuid contains the following files for
  36. building the sample distributed application CLUUID:
  37.  
  38. File          Description
  39.  
  40. README.TXT    Readme file for the cluuid sample
  41. CLUUID.IDL    Interface definition language file
  42. CLUUID.ACF    Attribute configuration file
  43. CLUUIDC.C     Client main program
  44. CLUUIDS.C     Server main program
  45. CLUUIDP.C     Remote procedures
  46. MAKEFILE      Nmake file to build for Windows NT or Windows 95
  47. MAKEFILE.DOS  Nmake file to build for MS-DOS
  48.  
  49. -------------------------------------------
  50. BUILDING CLIENT AND SERVER APPLICATIONS FOR
  51. MICROSOFT WINDOWS NT OR WINDOWS 95
  52. -------------------------------------------
  53.  
  54. The following environment variables should be already set for you:
  55.  
  56.   set CPU=i386
  57.   set INCLUDE=%SDKROOT%\h
  58.   set LIB=%SDKROOT%\lib
  59.   set PATH=%SDKROOT%\system32;%SDKROOT%\bin
  60.  
  61. where %SDKROOT% is the root directory for the 32-bit Windows SDK.
  62.  
  63. For mips, set CPU=mips
  64. For alpha, set CPU=alpha
  65.  
  66. Build the sample distributed application:
  67.  
  68.   nmake cleanall
  69.   nmake
  70.  
  71. This builds the executable programs cluuidc.exe(client) and 
  72. cluuids.exe (server).
  73.  
  74. -----------------------------------------------------------------------
  75. BUILDING THE CLIENT APPLICATION FOR MS-DOS
  76. -----------------------------------------------------------------------
  77.  
  78. After installing the Microsoft Visual C/C++ version 1.50 development
  79. environment and the 16-bit RPC SDK on a Windows NT or Windows 95
  80. computer, you can build the sample client application from Windows NT
  81. or Windows 95:
  82.  
  83.   nmake -f makefile.dos cleanall
  84.   nmake -f makefile.dos
  85.  
  86. This builds the client application cluuidc.exe.
  87.  
  88. You may also execute the Microsoft Visual C/C++ compiler under MS-DOS.
  89. This requires a two-step build process.
  90.  
  91.   Step One: Compile the .IDL files under Windows NT or Windows 95
  92.      nmake -a -f makefile.dos cluuid.h
  93.  
  94.   Step Two: Compile the C sources (stub and application) under MS-DOS
  95.      nmake -f makefile.dos
  96.  
  97. ------------------------------------------
  98. RUNNING THE CLIENT AND SERVER APPLICATIONS
  99. ------------------------------------------
  100.  
  101. On the server, enter:
  102.  
  103.   cluuids
  104.  
  105. On the client, enter:
  106.  
  107.   net start workstation
  108.   cluuidc
  109.  
  110. To call the second implementation of the function,
  111. on the client, enter:
  112.  
  113.   cluuidc -u "11111111-1111-1111-1111-111111111111"
  114.  
  115. Note: The client and server applications can run on the same Microsoft 
  116. Windows NT computer when you use different screen groups.
  117.  
  118. Several command line switches are available to change settings for this 
  119. program. For a listing of the switches available from the client program, 
  120. enter:
  121.  
  122.   cluuidc -?
  123.  
  124. For a listing of switches available from the server program, enter:
  125.  
  126.   cluuids -?
  127.  
  128. ---------------------
  129. RUNNING ON WINDOWS 95
  130. ---------------------
  131.  
  132. If you wish to run the server on Windows 95, you will need to use
  133. the LRPC protocol.
  134.  
  135. To start the server, enter:
  136.  
  137.  cluuids -p ncalrpc
  138.  
  139. To start the client (from the same machine), enter:
  140.  
  141.  cluuidc -p ncalrpc
  142.