|
|
1.1 ! root 1: /**************************************************************************** ! 2: Microsoft RPC Version 1.0 ! 3: Copyright Microsoft Corp. 1992 ! 4: Auto Example ! 5: ! 6: FILE: autoc.c ! 7: USAGE: client ! 8: ! 9: PURPOSE: Client side of RPC distributed application ! 10: FUNCTIONS: main() - binds to server and calls remote procedure ! 11: COMMENTS: ! 12: This distributed application uses auto handles. ! 13: ****************************************************************************/ ! 14: #include <stdio.h> ! 15: #include <string.h> ! 16: #include <stdlib.h> ! 17: #include <time.h> ! 18: #include <rpc.h> ! 19: #include "auto.h" ! 20: ! 21: void main(void) ! 22: { ! 23: time_t t1; ! 24: time_t t2; ! 25: char * pszTime; ! 26: RpcTryExcept { ! 27: GetTime(&t1); // GetTime is a remote procedure ! 28: GetTime(&t2); ! 29: ! 30: pszTime = ctime(&t1); ! 31: printf("time 1= %s\n", pszTime); ! 32: ! 33: pszTime = ctime(&t2); ! 34: printf("time 2= %s\n", pszTime); ! 35: ! 36: Shutdown(); // Shutdown is a remote procedure ! 37: } ! 38: RpcExcept(1) { ! 39: printf("The RPC runtime library raised exception %d.\n", RpcExceptionCode()); ! 40: printf("Please verify that the server application and \n"); ! 41: printf("the locator service have been started."); ! 42: } ! 43: RpcEndExcept ! 44: ! 45: exit(0); ! 46: ! 47: } ! 48: ! 49: // ==================================================================== ! 50: // MIDL allocate and free ! 51: // ==================================================================== ! 52: ! 53: ! 54: void * MIDL_user_allocate(size_t len) ! 55: { ! 56: return(malloc(len)); ! 57: } ! 58: ! 59: void MIDL_user_free(void * ptr) ! 60: { ! 61: free(ptr); ! 62: } ! 63: ! 64: /* end \autoc.c */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.