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 / whello / whellop.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-06-11  |  1.6 KB  |  52 lines

  1. /****************************************************************************
  2.                    Microsoft RPC Version 2.0
  3.            Copyright Microsoft Corp. 1992, 1993, 1994- 1996
  4.                          whello Example
  5.  
  6.     FILE:       whellop.c
  7.  
  8.     PURPOSE:    Remote procedures that are linked with the server
  9.                 side of RPC distributed application
  10.  
  11.     FUNCTIONS:  HelloProc() - prints "hello, world" or other string
  12.                 sent by client to server
  13.  
  14.     COMMENTS:   Windows version of the "Hello, world" example.
  15.  
  16.                 Windows can have several copies of your application
  17.                 running at the same time.  The variable hInst keeps
  18.                 track of which instance the application is so that
  19.                 processing will be to the correct window.
  20.  
  21. ****************************************************************************/
  22.  
  23. #include <stdlib.h>
  24. #include <stdio.h>
  25. #include "whello.h"    // header file generated by MIDL compiler
  26.  
  27. void HelloProc(unsigned char * pszString)
  28. {
  29.     printf("%s\n", pszString);
  30. }
  31.  
  32. void Shutdown(void)
  33. {
  34.     RPC_STATUS status;
  35.  
  36.     printf("Calling RpcMgmtStopServerListening\n");
  37.     status = RpcMgmtStopServerListening(NULL);
  38.     printf("RpcMgmtStopServerListening returned: 0x%x\n", status);
  39.     if (status) {
  40.         exit(status);
  41.     }
  42.  
  43.     printf("Calling RpcServerUnregisterIf\n");
  44.     status = RpcServerUnregisterIf(NULL, NULL, FALSE);
  45.     printf("RpcServerUnregisterIf returned 0x%x\n", status);
  46.     if (status) {
  47.         exit(status);
  48.     }
  49. }
  50.  
  51. /* end of file whellop.c */
  52.