home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / com / oleaut / browseh / browseh.odl < prev    next >
Encoding:
Text File  |  1997-09-30  |  13.5 KB  |  425 lines

  1. /*************************************************************************
  2. **
  3. **    OLE Automation BrowseHelper Object.
  4. **
  5. **    browseh.odl
  6. **
  7. **    Object Description source file.
  8. **
  9. **     Written by Microsoft Product Support Services, Windows Developer Support
  10. **    (c) Copyright Microsoft Corp. 1994 All Rights Reserved
  11. **
  12. *************************************************************************/ 
  13.  
  14.  
  15. [
  16.   uuid(19FEEEC0-4104-101B-B826-00DD01103DE1),              // LIBID_BrowseHelper
  17.   helpstring("BrowseHelper 1.0 Type Library"),
  18.   version(1.0)
  19. library BrowseHelper
  20. {
  21. #ifdef WIN32
  22.     importlib("stdole2.tlb");
  23. #else
  24.     importlib("stdole.tlb");
  25. #endif 
  26.     importlib("mydisp.tlb"); 
  27.     
  28.     // Forward declarations      
  29.     interface IArrayDesc;   
  30.     
  31.     typedef enum {
  32.        TYPE_FUNCTION = 0,
  33.        TYPE_PROPERTY = 1,
  34.        TYPE_CONSTANT = 2,
  35.        TYPE_PARAMETER = 3
  36.    } OBJTYPE;
  37.  
  38.     
  39.     [
  40.       uuid(19FEEECC-4104-101B-B826-00DD01103DE1),          // IID_ICollection                
  41.       helpstring("Generic collection."),
  42.       odl
  43.     ]
  44.     interface ICollection : CMyDispatch                         
  45.     {                
  46.       [propget, helpstring("Returns number of items in collection.")]
  47.       long Count();
  48.  
  49.       [propget, id(0), helpstring("Given an integer index, returns one of the items in the collection")]
  50.       IDispatch * Item([in] long Index);
  51.                         
  52.       [propget, restricted, id(-4)]    // -4 is DISPID_NEWENUM. Must be propget.
  53.       IUnknown * _NewEnum();           
  54.     }  
  55.         
  56.     [
  57.       uuid(19FEEEC3-4104-101B-B826-00DD01103DE1),          // IID_ITypeLibrary                    
  58.       helpstring("TypeLibrary object."),
  59.       odl
  60.     ]
  61.     interface ITypeLibrary : CMyDispatch                         
  62.     {
  63.       [propget, helpstring("Returns the name.")]
  64.       BSTR Name(void);
  65.         
  66.       [propget, helpstring("Returns the documentation string.")]
  67.       BSTR Documentation(void);
  68.         
  69.       [propget, helpstring("Returns the help context.")]
  70.       long HelpContext(void);
  71.         
  72.       [propget, helpstring("Returns the help file.")]
  73.       BSTR HelpFile(void);
  74.       
  75.       [propget, helpstring("Returns Locale ID.")]
  76.       long LocaleID(void);  
  77.       
  78.       [propget, helpstring("Returns Major Version.")]
  79.       int MajorVersion(void);
  80.       
  81.       [propget, helpstring("Returns Minor Version.")]
  82.       int MinorVersion(void);
  83.         
  84.       [propget, helpstring("Returns collection of TypeInfos.")]
  85.       ICollection* TypeInfos(void);
  86.       
  87.       [propget, helpstring("Returns GUID as a string.")]
  88.       BSTR GUIDAsString(void);
  89.     }      
  90.     
  91.     [
  92.       uuid(19FEEEC4-4104-101B-B826-00DD01103DE1),          // IID_ITypeInformation                    
  93.       helpstring("TypeInfo object."),
  94.       odl
  95.     ]
  96.     interface ITypeInformation : CMyDispatch                         
  97.     {
  98.       [propget, helpstring("Returns the name.")]
  99.       BSTR Name(void);
  100.         
  101.       [propget, helpstring("Returns the documentation string.")]
  102.       BSTR Documentation(void);
  103.         
  104.       [propget, helpstring("Returns the help context.")]
  105.       long HelpContext(void);
  106.         
  107.       [propget, helpstring("Returns the help file.")]
  108.       BSTR HelpFile(void);
  109.       
  110.       [propget, helpstring("Returns TYPEKIND.")]
  111.       TYPEKIND TypeInfoKind(void);
  112.  
  113.       [propget, helpstring("Returns TYPEFLAGS")]
  114.       short TypeFlags();
  115.  
  116.       [propget, helpstring("Returns GUID as a string.")]
  117.       BSTR GUIDAsString(void);
  118.       
  119.       HRESULT _InitTypeInfo([in]LPTYPEINFO ptinfo);                                                              
  120.     }
  121.     
  122.     [
  123.       uuid(19FEEEC2-4104-101B-B826-00DD01103DE1),          // IID_IBrowseHelper               
  124.       helpstring("BrowseHelper object."),
  125.       odl
  126.     ]
  127.     interface IBrowseHelper : CMyDispatch                         
  128.     {
  129.       [helpstring("Opens and browses the specified type library and returns TypeLibrary object")]
  130.       ITypeLibrary* BrowseTypeLibrary([in] BSTR TypeLibraryPath);                                    
  131.     }  
  132.  
  133.     
  134.     [
  135.       uuid(19FEEED1-4104-101B-B826-00DD01103DE1),          // IID_ITypeDesc                  
  136.       helpstring("TypeDescription object."),
  137.       odl
  138.     ]
  139.     interface ITypeDesc : CMyDispatch                         
  140.     {        
  141.       [propget, helpstring("Returns the type as VARTYPE.")]
  142.       short Type(void);
  143.       
  144.       [propget, helpstring("Returns a TypeInformation object with more information about the VT_USERDEFINED type.")]
  145.       ITypeInformation* UserDefinedDesc(void);    
  146.       
  147.       [propget, helpstring("Returns an ArrayDesc with more information about the VT_CARRAY type.")]
  148.       IArrayDesc* ArrayDesc(void);
  149.         
  150.       [propget, helpstring("Returns a TypeDesc object with more information about the VT_PTR type.")]
  151.       ITypeDesc* PointerDesc(void);
  152.     } 
  153.     
  154.     [
  155.       uuid(19FEEED3-4104-101B-B826-00DD01103DE1),          // IID_IArrayBound                
  156.       helpstring("ArrayBound object."),
  157.       odl
  158.     ]
  159.     interface IArrayBound : CMyDispatch                         
  160.     {        
  161.       [propget, helpstring("Number of elements in this dimension of the array.")]
  162.       long ElementsCount(void); 
  163.       
  164.       [propget, helpstring("Lower bound in this dimension of the array.")]
  165.       long LowerBound(void);
  166.     } 
  167.     
  168.         
  169.     [
  170.       uuid(19FEEED2-4104-101B-B826-00DD01103DE1),          // IID_IArrayDesc                 
  171.       helpstring("ArrayDesc object."),
  172.       odl
  173.     ]
  174.     interface IArrayDesc : CMyDispatch                         
  175.     {        
  176.       [propget, helpstring("Returns the array element type.")]
  177.       ITypeDesc* ElementType(void); 
  178.       
  179.       [propget, helpstring("Returns a collection of array bounds.")]
  180.       ICollection* ArrayBounds(void);
  181.     } 
  182.     
  183.     [
  184.       uuid(19FEEEC5-4104-101B-B826-00DD01103DE1),          // IID_IInterface                    
  185.       helpstring("Interface object."),
  186.       odl
  187.     ]
  188.     interface IInterface : ITypeInformation                     
  189.     {      
  190.       [propget, helpstring("Returns collection of functions.")]
  191.       ICollection* Functions(void);
  192.  
  193.       [propget, helpstring("Returns base interface.")]
  194.       IInterface* BaseInterface(void);
  195.     } 
  196.     
  197.     [
  198.       uuid(19FEEEC6-4104-101B-B826-00DD01103DE1),          // IID_IDispinterface                    
  199.       helpstring("Dispinterface object."),
  200.       odl
  201.     ]
  202.     interface IDispinterface : ITypeInformation                     
  203.     {
  204.       [propget, helpstring("Returns collection of properties.")]
  205.       ICollection* Properties(void);
  206.         
  207.       [propget, helpstring("Returns collection of methods.")]
  208.       ICollection* Methods(void);
  209.  
  210.       [propget, helpstring("Return Interface part of dual interface, if this is a dual interface.")]
  211.       IInterface* Interface(void);
  212.     }  
  213.     
  214.     [
  215.       uuid(19FEEEC7-4104-101B-B826-00DD01103DE1),          // IID_IModule                   
  216.       helpstring("Module object."),
  217.       odl
  218.     ]
  219.     interface IModule : ITypeInformation                     
  220.     {      
  221.       [propget, helpstring("Returns collection of functions.")]
  222.       ICollection* Functions(void);
  223.     }  
  224.     
  225.     [
  226.       uuid(19FEEEC8-4104-101B-B826-00DD01103DE1),          // IID_ICoClass                    
  227.       helpstring("CoClass object."),
  228.       odl
  229.     ]
  230.     interface ICoClass : ITypeInformation                         
  231.     {
  232.       [propget, helpstring("Returns collection of interfaces/dispinterfaces.")]
  233.       ICollection* Interfaces(void);        
  234.     } 
  235.     
  236.     [
  237.       uuid(19FEEECD-4104-101B-B826-00DD01103DE1),          // IID_IEnum                  
  238.       helpstring("Enum object."),
  239.       odl
  240.     ]
  241.     interface IEnum : ITypeInformation                         
  242.     {
  243.       [propget, helpstring("Returns collection of enumerated elements.")]
  244.       ICollection* Elements(void);       
  245.     }   
  246.     
  247.     [
  248.       uuid(19FEEECE-4104-101B-B826-00DD01103DE1),          // IID_IStruct                  
  249.       helpstring("Struct object."),
  250.       odl
  251.     ]
  252.     interface IStruct : ITypeInformation                         
  253.     {
  254.       [propget, helpstring("Returns collection of structure members.")]
  255.       ICollection* Members(void);       
  256.     }  
  257.     
  258.     [
  259.       uuid(19FEEECF-4104-101B-B826-00DD01103DE1),          // IID_IStruct                  
  260.       helpstring("Struct object."),
  261.       odl
  262.     ]
  263.     interface IUnion : ITypeInformation                         
  264.     {
  265.       [propget, helpstring("Returns collection of union members.")]
  266.       ICollection* Members(void);       
  267.     }    
  268.     
  269.     [
  270.       uuid(19FEEED0-4104-101B-B826-00DD01103DE1),          // IID_IAlias                 
  271.       helpstring("Alias object."),
  272.       odl
  273.     ]
  274.     interface IAlias : ITypeInformation                         
  275.     {
  276.       [propget, helpstring("Returns Base Type.")]
  277.       ITypeDesc* BaseType();       
  278.     }                                                                     
  279.     
  280.     [
  281.       uuid(19FEEEC9-4104-101B-B826-00DD01103DE1),          // IID_IFunction                    
  282.       helpstring("Function object."),
  283.       odl
  284.     ]
  285.     interface IFunction : CMyDispatch                         
  286.     {
  287.       [propget, helpstring("Returns name.")]
  288.       BSTR Name();   
  289.       
  290.       [propget, helpstring("Returns the documentation string.")]
  291.       BSTR Documentation(void);
  292.         
  293.       [propget, helpstring("Returns the help context.")]
  294.       long HelpContext(void);
  295.         
  296.       [propget, helpstring("Returns the help file.")]
  297.       BSTR HelpFile(void);
  298.       
  299.       [propget, helpstring("Returns a ITypeDesc object that describes the return type of function.")]
  300.       ITypeDesc* ReturnType();
  301.       
  302.       [propget, helpstring("Returns collection of parameters of function.")]
  303.       ICollection* Parameters(); 
  304.       
  305.       [propget, helpstring("Returns Memid (Also called DISPID).")]
  306.       MEMBERID Memberid(); 
  307.       
  308.       [propget, helpstring("Returns calling convention.")]
  309.       CALLCONV CallConvention();
  310.       
  311.       [propget, helpstring("Returns FUNCKIND.")]
  312.       FUNCKIND FuncKind();
  313.       
  314.       [propget, helpstring("Returns INVOKEKIND.")]
  315.       INVOKEKIND InvocationKind();
  316.       
  317.       [propget, helpstring("Returns FUNCDESC.cParamsOpt, the number of optional parameters")]
  318.       short NumberOfOptionalParams();
  319.  
  320.       [propget, helpstring("Returns FUNCDESC.oVft, offset in vtbl")]
  321.       short OffsetInVtbl();
  322.  
  323.       [propget, helpstring("Returns FUNCDESC.wfuncFlags")]
  324.       unsigned short FuncFlags();
  325.  
  326.       [propget, helpstring("Returns kind of object (function == 0).")]
  327.       OBJTYPE Kind();
  328.       
  329.     }
  330.     
  331.     [
  332.       uuid(19FEEECA-4104-101B-B826-00DD01103DE1),          // IID_IProperty                
  333.       helpstring("Property object."),
  334.       odl
  335.     ]
  336.     interface IProperty : CMyDispatch                         
  337.     {
  338.       [propget, helpstring("Returns name.")]
  339.       BSTR Name();   
  340.       
  341.       [propget, helpstring("Returns the documentation string.")]
  342.       BSTR Documentation(void);
  343.         
  344.       [propget, helpstring("Returns the help context.")]
  345.       long HelpContext(void);
  346.         
  347.       [propget, helpstring("Returns the help file.")]
  348.       BSTR HelpFile(void);
  349.  
  350.       [propget, helpstring("Returns a ITypeDesc object that describes the type of property.")]
  351.       ITypeDesc* Type();
  352.       
  353.       [propget, helpstring("Returns memid.")]
  354.       MEMBERID Memberid();
  355.       
  356.       [propget, helpstring("Returns kind of object (property == 1).")]
  357.       OBJTYPE Kind();
  358.    
  359.     }  
  360.     
  361.     [
  362.       uuid(19FEEED4-4104-101B-B826-00DD01103DE1),          // IID_IConstant              
  363.       helpstring("Symbolic constant."),
  364.       odl
  365.     ]
  366.     interface IConstant : CMyDispatch                         
  367.     {
  368.       [propget, helpstring("Returns name.")]
  369.       BSTR Name();   
  370.       
  371.       [propget, helpstring("Returns the documentation string.")]
  372.       BSTR Documentation(void);
  373.         
  374.       [propget, helpstring("Returns the help context.")]
  375.       long HelpContext(void);
  376.         
  377.       [propget, helpstring("Returns the help file.")]
  378.       BSTR HelpFile(void);
  379.  
  380.       [propget, helpstring("Returns a ITypeDesc object that describes the type of constant.")]
  381.       ITypeDesc* Type();
  382.       
  383.       [propget, helpstring("Returns value of constant.")]
  384.       VARIANT Value();   
  385.       
  386.       [propget, helpstring("Returns memid.")]
  387.       MEMBERID Memberid();
  388.       
  389.       [propget, helpstring("Returns kind of object (constant == 2).")]
  390.       OBJTYPE Kind();   
  391.     }
  392.     
  393.     [
  394.       uuid(19FEEECB-4104-101B-B826-00DD01103DE1),          // IID_IParameter               
  395.       helpstring("Parameter object."),
  396.       odl
  397.     ]
  398.     interface IParameter: CMyDispatch                         
  399.     {
  400.       [propget, helpstring("Returns name of parameter.")]
  401.       BSTR Name();
  402.  
  403.       [propget, helpstring("Returns a ITypeDesc object that describes the type of parameter.")]
  404.       ITypeDesc* Type();    
  405.       
  406.       [propget, helpstring("Returns IDL flags of parameter.")]
  407.       int IDLFlags();
  408.       
  409.       [propget, helpstring("Returns kind of object (parameter == 3).")]
  410.       OBJTYPE Kind();    
  411.     }
  412.     
  413.     [
  414.       uuid(19FEEEC1-4104-101B-B826-00DD01103DE1),          // CLSID_TypeLibrary
  415.       helpstring("BrowseHelper Class"),
  416.       appobject
  417.     ]                                             
  418.     coclass BrowseHelper
  419.     {   
  420.       interface IBrowseHelper;
  421.     }
  422. }
  423.  
  424.