home *** CD-ROM | disk | FTP | other *** search
/ Enter 2003 March / EnterCD 03_2003.iso / Multimedia / IntelliCAD 2001 3.3 / data1.cab / API / sds / ourbase / invoke.cpp next >
Encoding:
C/C++ Source or Header  |  2003-01-05  |  3.4 KB  |  90 lines

  1. //  INVOKE.CPP                                                        
  2. //                                                                   
  3. // .............................................................................
  4. //
  5. // Copyright (c) 1998 by Visio Corporation.  All rights reserved.
  6. //
  7. // The Software is subject to the license agreement that accompanies 
  8. // or is included with the Software, which specifies the permitted 
  9. // and prohibited uses of the Software. Any unauthorized duplication 
  10. // or use of Visio Corporation Software, in whole or in part, in print, 
  11. // or in any other storage and retrieval system is prohibited.
  12. // 
  13. // To the maximum extent permitted by applicable law, Visio Corporation
  14. // and its suppliers disclaim any and all warranties and conditions,
  15. // either express or implied, including, without limitation, implied
  16. // warranties of merchantability, fitness for a particular purpose,
  17. // title, and non-infringement, and those arising out of usage of trade
  18. // or course of dealing, concerning these materials.  These materials
  19. // are provided "as is" without warranty of any kind.
  20. // .............................................................................
  21.  
  22.  
  23.  
  24. #include "sds.h"
  25. #include "string.h"
  26.  
  27.  
  28. int main(int argc, char **argv) {
  29.     short linkstat;
  30.     short fcode;
  31.     struct sds_resbuf *argbuf,*trb;
  32.  
  33.     sds_init(argc,argv); 
  34.     sds_printf("\nLoading INVOKE application.");
  35.  
  36.     for(;;) {
  37.         if ((linkstat=sds_link(RSRSLT))<0) {
  38.              sds_printf("\nERROR: Unable to link with IntelliCAD - %d", linkstat);
  39.              sds_exit(-1);
  40.         }
  41.         
  42.         sds_printf("\nLink Status = %d",linkstat);
  43.  
  44.         switch(linkstat) {
  45.             case RQXLOAD: 
  46.                 if (!sds_defun("C:INVOKETEST",1))  return(-1);
  47.                 break;
  48.             case RQXUNLD: 
  49.                 break;
  50.             case RQSUBR : 
  51.                 if((fcode=sds_getfuncode())<0) return(0);
  52.                 switch(fcode) {
  53.                     case 1: 
  54.                         sds_printf("\nTesting sds_getargs...  ");
  55.                         for(argbuf=trb=sds_getargs(); trb!=NULL; trb=trb->rbnext) {
  56.                             sds_printf("\nThe type is %i.",trb->restype);
  57.                             switch(trb->restype){
  58.                                 case RTREAL:    sds_printf("\n    The argument is a real. Its value is %f. ",trb->resval.rreal);    
  59.                                                 break;                                
  60.                                 case RTPOINT:   sds_printf("\n    The argument is a 2D point. Its x and y values are %f,%f. ",trb->resval.rpoint[0],trb->resval.rpoint[1]);    
  61.                                                 break;                                
  62.                                 case RTSHORT:   sds_printf("\n    The argument is a short. Its value is %i. ",trb->resval.rint);    
  63.                                                 break;                                 
  64.                                 case RTSTR:     sds_printf("\n    The argument is a string.  The string is \"%s\".",trb->resval.rstring);
  65.                                                 break;
  66.                                 case RT3DPOINT:    sds_printf("\n      The argument is a 3D point.  Its x, y, and z values are %f,%f,%f. ",trb->resval.rpoint[0],trb->resval.rpoint[1],trb->resval.rpoint[2]);
  67.                                                 break;
  68.                                 case RTLONG:    sds_printf("\n    The argument is a long.  It's value is %ld. ",trb->resval.rlong);
  69.                                                 break;
  70.                                 default:        sds_printf("\n    The argument is not one of the usual types.");
  71.                             }
  72.                         }
  73.                         sds_printf("\nDone testing sds_getargs.");
  74.                         sds_relrb(argbuf);
  75.                         sds_retvoid();
  76.                         break;
  77.                 }
  78.                 break;
  79.             case RQEND  : 
  80.                 break;
  81.             case RQQUIT : 
  82.                 break;
  83.             case RQSAVE :
  84.             default     : break;
  85.         }
  86.     }
  87.     return(0);
  88. }
  89.  
  90.