opcda.idl
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:20k
源码类别:

VxWorks

开发平台:

C/C++

  1. // OPCDA.IDL
  2. // REVISION:  10/14/98 04:00 PM (EST)
  3. // VERSIONINFO 2.0.0.0
  4. // 12/05/97 acc fixed UNCERTAIN bits, add AsyncIO2, OPCDataCallback, 
  5. //                OPCItemProperties,  BROWSE_TO
  6. // 06/19/98 acc change V2 uuids prior to final release
  7. //              to avoid conflict with 'old' OPCDA Automation uuids
  8. // 10/14/98 acc change asynchio2::refresh() to refresh2() to avoid footprint
  9. //               conflict for implementors using multiple inheritance.
  10. //
  11. #ifdef _WIN32
  12. import "oaidl.idl" ;
  13. #else
  14. import "vxidl.idl";
  15. #endif
  16. typedef enum tagOPCDATASOURCE { 
  17.     OPC_DS_CACHE = 1, 
  18.     OPC_DS_DEVICE } OPCDATASOURCE ;
  19. typedef enum tagOPCBROWSETYPE { 
  20.     OPC_BRANCH = 1, 
  21.     OPC_LEAF, 
  22.     OPC_FLAT} OPCBROWSETYPE;
  23. typedef enum tagOPCNAMESPACETYPE { 
  24.     OPC_NS_HIERARCHIAL = 1, 
  25.     OPC_NS_FLAT} OPCNAMESPACETYPE;
  26. typedef enum tagOPCBROWSEDIRECTION { 
  27.     OPC_BROWSE_UP = 1, 
  28.     OPC_BROWSE_DOWN, OPC_BROWSE_TO} OPCBROWSEDIRECTION;
  29. // **NOTE** the 1.0 IDL contained an error for ACCESSRIGHTS. 
  30. // They should not have been an ENUM.
  31. // They should have been two mask bits as noted here.
  32. cpp_quote("#define OPC_READABLE    1")
  33. cpp_quote("#define OPC_WRITEABLE   2")
  34. typedef enum tagOPCEUTYPE { 
  35.     OPC_NOENUM = 0, 
  36.     OPC_ANALOG, 
  37.     OPC_ENUMERATED } OPCEUTYPE;
  38. typedef enum tagOPCSERVERSTATE { 
  39.     OPC_STATUS_RUNNING = 1, 
  40.     OPC_STATUS_FAILED, 
  41.     OPC_STATUS_NOCONFIG, 
  42.     OPC_STATUS_SUSPENDED, 
  43.     OPC_STATUS_TEST } OPCSERVERSTATE;
  44. typedef enum tagOPCENUMSCOPE { OPC_ENUM_PRIVATE_CONNECTIONS = 1, 
  45.     OPC_ENUM_PUBLIC_CONNECTIONS, 
  46.     OPC_ENUM_ALL_CONNECTIONS, 
  47.     OPC_ENUM_PRIVATE, 
  48.     OPC_ENUM_PUBLIC, 
  49.     OPC_ENUM_ALL } OPCENUMSCOPE;
  50. typedef DWORD OPCHANDLE;
  51. typedef struct tagOPCGROUPHEADER {
  52.     DWORD       dwSize;
  53.     DWORD       dwItemCount;
  54.     OPCHANDLE   hClientGroup;
  55.     DWORD       dwTransactionID;
  56.     HRESULT     hrStatus;
  57. } OPCGROUPHEADER;
  58. typedef struct tagOPCITEMHEADER1 {
  59.     OPCHANDLE   hClient;
  60.     DWORD       dwValueOffset;
  61.     WORD        wQuality;
  62.     WORD        wReserved;
  63.     FILETIME    ftTimeStampItem;
  64. } OPCITEMHEADER1;
  65. typedef struct tagOPCITEMHEADER2 {
  66.     OPCHANDLE   hClient;
  67.     DWORD       dwValueOffset;
  68.     WORD        wQuality;
  69.     WORD        wReserved;
  70. } OPCITEMHEADER2;
  71. typedef struct tagOPCGROUPHEADERWRITE {
  72.     DWORD       dwItemCount;
  73.     OPCHANDLE   hClientGroup;
  74.     DWORD       dwTransactionID;
  75.     HRESULT     hrStatus;
  76. } OPCGROUPHEADERWRITE;
  77. typedef struct tagOPCITEMHEADERWRITE {
  78.     OPCHANDLE   hClient;
  79.     HRESULT     dwError;
  80. } OPCITEMHEADERWRITE;
  81. typedef struct tagOPCITEMSTATE{
  82.     OPCHANDLE   hClient;
  83.     FILETIME    ftTimeStamp;
  84.     WORD        wQuality;
  85.     WORD        wReserved;
  86.     VARIANT     vDataValue;
  87. } OPCITEMSTATE;
  88. typedef struct tagOPCSERVERSTATUS {
  89.            FILETIME       ftStartTime;
  90.            FILETIME       ftCurrentTime;
  91.            FILETIME       ftLastUpdateTime;
  92.            OPCSERVERSTATE dwServerState;
  93.            DWORD          dwGroupCount; 
  94.            DWORD          dwBandWidth;
  95.            WORD           wMajorVersion;
  96.            WORD           wMinorVersion;
  97.            WORD           wBuildNumber;
  98.            WORD           wReserved;
  99.   [string] LPWSTR         szVendorInfo;
  100. } OPCSERVERSTATUS;
  101. typedef struct tagOPCITEMDEF {
  102.   [string]              LPWSTR     szAccessPath;
  103.   [string]              LPWSTR     szItemID;
  104.                         BOOL       bActive ;
  105.                         OPCHANDLE  hClient;
  106.                         DWORD      dwBlobSize;
  107.   [size_is(dwBlobSize)] BYTE     * pBlob;
  108.                         VARTYPE    vtRequestedDataType;
  109.                         WORD       wReserved;
  110. } OPCITEMDEF;
  111. typedef struct tagOPCITEMATTRIBUTES {
  112.   [string]              LPWSTR     szAccessPath;
  113.   [string]              LPWSTR     szItemID;
  114.                         BOOL       bActive;
  115.                         OPCHANDLE  hClient;
  116.                         OPCHANDLE  hServer;
  117.                         DWORD      dwAccessRights;
  118.                         DWORD      dwBlobSize;
  119.   [size_is(dwBlobSize)] BYTE     * pBlob;
  120.                         VARTYPE    vtRequestedDataType;
  121.                         VARTYPE    vtCanonicalDataType;
  122.                         OPCEUTYPE  dwEUType;
  123.                         VARIANT    vEUInfo;
  124. } OPCITEMATTRIBUTES;
  125. typedef struct tagOPCITEMRESULT {
  126.                         OPCHANDLE  hServer;
  127.                         VARTYPE    vtCanonicalDataType;
  128.                         WORD       wReserved;
  129.                         DWORD      dwAccessRights;
  130.                         DWORD      dwBlobSize;
  131.   [size_is(dwBlobSize)] BYTE     * pBlob;
  132. } OPCITEMRESULT;
  133. //****************************************************
  134. // OPC Quality flags 
  135. //
  136. // Masks for extracting quality subfields
  137. // (note 'status' mask also includes 'Quality' bits)
  138. //
  139. cpp_quote("#define    OPC_QUALITY_MASK            0xC0")
  140. cpp_quote("#define    OPC_STATUS_MASK             0xFC")
  141. cpp_quote("#define    OPC_LIMIT_MASK              0x03")
  142. // Values for QUALITY_MASK bit field
  143. //
  144. cpp_quote("#define    OPC_QUALITY_BAD             0x00")
  145. cpp_quote("#define    OPC_QUALITY_UNCERTAIN       0x40")
  146. cpp_quote("#define    OPC_QUALITY_GOOD            0xC0")
  147. // STATUS_MASK Values for Quality = BAD
  148. //
  149. cpp_quote("#define    OPC_QUALITY_CONFIG_ERROR    0x04")
  150. cpp_quote("#define    OPC_QUALITY_NOT_CONNECTED   0x08")
  151. cpp_quote("#define    OPC_QUALITY_DEVICE_FAILURE  0x0c")
  152. cpp_quote("#define    OPC_QUALITY_SENSOR_FAILURE  0x10")
  153. cpp_quote("#define    OPC_QUALITY_LAST_KNOWN      0x14")
  154. cpp_quote("#define    OPC_QUALITY_COMM_FAILURE    0x18")
  155. cpp_quote("#define    OPC_QUALITY_OUT_OF_SERVICE  0x1C")
  156. // STATUS_MASK Values for Quality = UNCERTAIN
  157. //
  158. cpp_quote("#define    OPC_QUALITY_LAST_USABLE     0x44")
  159. cpp_quote("#define    OPC_QUALITY_SENSOR_CAL      0x50")
  160. cpp_quote("#define    OPC_QUALITY_EGU_EXCEEDED    0x54")
  161. cpp_quote("#define    OPC_QUALITY_SUB_NORMAL      0x58")
  162. // STATUS_MASK Values for Quality = GOOD
  163. //
  164. cpp_quote("#define    OPC_QUALITY_LOCAL_OVERRIDE  0xD8")
  165. // Values for Limit Bitfield 
  166. //
  167. cpp_quote("#define    OPC_LIMIT_OK                0x00")
  168. cpp_quote("#define    OPC_LIMIT_LOW               0x01")
  169. cpp_quote("#define    OPC_LIMIT_HIGH              0x02")
  170. cpp_quote("#define    OPC_LIMIT_CONST             0x03")
  171. //****************************************************
  172. //Interface Definitions
  173. //
  174. //****************************************************
  175. [
  176.   object,
  177.   uuid(39c13a4d-011e-11d0-9675-0020afd8adb3),
  178.   pointer_default(unique)
  179. ]
  180. interface IOPCServer : IUnknown
  181. {
  182.   HRESULT AddGroup(
  183.     [in, string]        LPCWSTR     szName,
  184.     [in]                BOOL        bActive,
  185.     [in]                DWORD       dwRequestedUpdateRate,
  186.     [in]                OPCHANDLE   hClientGroup,
  187.     [unique, in]        LONG      * pTimeBias,
  188.     [unique, in]        FLOAT     * pPercentDeadband,
  189.     [in]                DWORD       dwLCID,
  190.     [out]               OPCHANDLE * phServerGroup,
  191.     [out]               DWORD     * pRevisedUpdateRate,
  192.     [in]                REFIID      riid,
  193.     [out, iid_is(riid)] LPUNKNOWN * ppUnk
  194.     );
  195.   HRESULT GetErrorString( 
  196.     [in]          HRESULT  dwError,
  197.     [in]          LCID     dwLocale,
  198.     [out, string] LPWSTR * ppString
  199.     );
  200.   HRESULT GetGroupByName(
  201.     [in, string]        LPCWSTR szName,
  202.     [in]                REFIID riid,
  203.     [out, iid_is(riid)] LPUNKNOWN * ppUnk
  204.     );
  205.   HRESULT GetStatus( 
  206.     [out] OPCSERVERSTATUS ** ppServerStatus
  207.     );
  208.   HRESULT RemoveGroup(
  209.     [in] OPCHANDLE hServerGroup,
  210.     [in] BOOL      bForce
  211.     );
  212.   HRESULT CreateGroupEnumerator(
  213.     [in] OPCENUMSCOPE dwScope, 
  214.     [in] REFIID       riid, 
  215.     [out, iid_is(riid)] LPUNKNOWN* ppUnk
  216.     );
  217. }
  218. //****************************************************
  219. [
  220.   object,
  221.   uuid(39c13a4e-011e-11d0-9675-0020afd8adb3),
  222.   pointer_default(unique)
  223. ]
  224. interface IOPCServerPublicGroups : IUnknown
  225. {
  226.   HRESULT GetPublicGroupByName(
  227.     [in, string]        LPCWSTR     szName,
  228.     [in]                REFIID      riid,
  229.     [out, iid_is(riid)] LPUNKNOWN * ppUnk
  230.     );
  231.   HRESULT RemovePublicGroup(
  232.     [in] OPCHANDLE hServerGroup,
  233.     [in] BOOL      bForce
  234.     );
  235. }
  236. //****************************************************
  237. [
  238.   object,
  239.   uuid(39c13a4f-011e-11d0-9675-0020afd8adb3),
  240.   pointer_default(unique)
  241. ]
  242. interface IOPCBrowseServerAddressSpace: IUnknown
  243. {
  244.   HRESULT QueryOrganization(
  245.     [out] OPCNAMESPACETYPE  * pNameSpaceType
  246.     );
  247.   HRESULT ChangeBrowsePosition(
  248.     [in]         OPCBROWSEDIRECTION dwBrowseDirection,  
  249.     [in, string] LPCWSTR            szString
  250.     );
  251.   HRESULT BrowseOPCItemIDs(
  252.     [in]         OPCBROWSETYPE   dwBrowseFilterType,
  253.     [in, string] LPCWSTR         szFilterCriteria,  
  254.     [in]         VARTYPE         vtDataTypeFilter,     
  255.     [in]         DWORD           dwAccessRightsFilter,
  256.     [out]        LPENUMSTRING  * ppIEnumString
  257.     );        
  258.   HRESULT GetItemID(
  259.     [in]          LPWSTR   szItemDataID,
  260.     [out, string] LPWSTR * szItemID
  261.     );
  262.   HRESULT BrowseAccessPaths(
  263.     [in, string] LPCWSTR        szItemID,  
  264.     [out]        LPENUMSTRING * ppIEnumString
  265.     );
  266. }
  267. //****************************************************
  268. [
  269.   object,
  270.   uuid(39c13a50-011e-11d0-9675-0020afd8adb3),
  271.   pointer_default(unique)
  272. ]
  273. interface IOPCGroupStateMgt : IUnknown
  274. {
  275.   HRESULT GetState(
  276.     [out]         DWORD     * pUpdateRate, 
  277.     [out]         BOOL      * pActive, 
  278.     [out, string] LPWSTR    * ppName,
  279.     [out]         LONG      * pTimeBias,
  280.     [out]         FLOAT     * pPercentDeadband,
  281.     [out]         DWORD     * pLCID,
  282.     [out]         OPCHANDLE * phClientGroup,
  283.     [out]         OPCHANDLE * phServerGroup
  284.     );
  285.   HRESULT SetState( 
  286.     [unique, in]  DWORD     * pRequestedUpdateRate, 
  287.     [out]         DWORD     * pRevisedUpdateRate, 
  288.     [unique, in]  BOOL      * pActive, 
  289.     [unique, in]  LONG      * pTimeBias,
  290.     [unique, in]  FLOAT     * pPercentDeadband,
  291.     [unique, in]  DWORD     * pLCID,
  292.     [unique, in]  OPCHANDLE * phClientGroup
  293.     );
  294.   HRESULT SetName( 
  295.     [in, string] LPCWSTR szName
  296.     );
  297.   HRESULT CloneGroup(
  298.     [in, string]        LPCWSTR     szName,
  299.     [in]                REFIID      riid,
  300.     [out, iid_is(riid)] LPUNKNOWN * ppUnk
  301.     );
  302. }
  303. //****************************************************
  304. [
  305.   object,
  306.   uuid(39c13a51-011e-11d0-9675-0020afd8adb3),
  307.   pointer_default(unique)
  308. ]
  309. interface IOPCPublicGroupStateMgt : IUnknown
  310. {
  311.   HRESULT GetState(
  312.     [out] BOOL * pPublic
  313.     );
  314.   HRESULT MoveToPublic(
  315.     void
  316.     );
  317. }
  318. //****************************************************
  319. [
  320.   object,
  321.   uuid(39c13a52-011e-11d0-9675-0020afd8adb3),
  322.   pointer_default(unique)
  323. ]
  324. interface IOPCSyncIO : IUnknown
  325. {
  326.   HRESULT Read(
  327.     [in]                        OPCDATASOURCE   dwSource,
  328.     [in]                        DWORD           dwCount, 
  329.     [in, size_is(dwCount)]      OPCHANDLE     * phServer, 
  330.     [out, size_is(,dwCount)]    OPCITEMSTATE ** ppItemValues,
  331.     [out, size_is(,dwCount)]    HRESULT      ** ppErrors
  332.     );
  333.   HRESULT Write(
  334.     [in]                        DWORD        dwCount, 
  335.     [in, size_is(dwCount)]      OPCHANDLE  * phServer, 
  336.     [in, size_is(dwCount)]      VARIANT    * pItemValues, 
  337.     [out, size_is(,dwCount)]    HRESULT   ** ppErrors
  338.     );
  339. }
  340. //****************************************************
  341. [
  342.   object,
  343.   uuid(39c13a53-011e-11d0-9675-0020afd8adb3),
  344.   pointer_default(unique)
  345. ]
  346. interface IOPCAsyncIO : IUnknown
  347. {
  348.   HRESULT Read(
  349.     [in]                        DWORD           dwConnection,
  350.     [in]                        OPCDATASOURCE   dwSource,
  351.     [in]                        DWORD           dwCount,
  352.     [in, size_is(dwCount)]      OPCHANDLE     * phServer,
  353.     [out]                       DWORD         * pTransactionID,
  354.     [out, size_is(,dwCount)]    HRESULT      ** ppErrors
  355.     );
  356.   HRESULT Write(
  357.     [in]                        DWORD       dwConnection,
  358.     [in]                        DWORD       dwCount, 
  359.     [in, size_is(dwCount)]      OPCHANDLE * phServer,
  360.     [in, size_is(dwCount)]      VARIANT   * pItemValues, 
  361.     [out]                       DWORD     * pTransactionID,
  362.     [out, size_is(,dwCount)]    HRESULT  ** ppErrors
  363.     );
  364.   HRESULT Refresh(
  365.     [in]  DWORD           dwConnection,
  366.     [in]  OPCDATASOURCE   dwSource,
  367.     [out] DWORD         * pTransactionID
  368.     );
  369.   HRESULT Cancel(
  370.     [in] DWORD dwTransactionID
  371.     );
  372. }
  373. //****************************************************
  374. [
  375.   object,
  376.   uuid(39c13a54-011e-11d0-9675-0020afd8adb3),
  377.   pointer_default(unique)
  378. ]
  379. interface IOPCItemMgt: IUnknown
  380. {
  381.   HRESULT AddItems( 
  382.     [in]                        DWORD            dwCount,
  383.     [in, size_is(dwCount)]      OPCITEMDEF     * pItemArray,
  384.     [out, size_is(,dwCount)]    OPCITEMRESULT ** ppAddResults,
  385.     [out, size_is(,dwCount)]    HRESULT       ** ppErrors
  386.     );
  387.   HRESULT ValidateItems( 
  388.     [in]                        DWORD             dwCount,
  389.     [in, size_is(dwCount)]      OPCITEMDEF      * pItemArray,
  390.     [in]                        BOOL              bBlobUpdate,
  391.     [out, size_is(,dwCount)]    OPCITEMRESULT  ** ppValidationResults,
  392.     [out, size_is(,dwCount)]    HRESULT        ** ppErrors
  393.     );
  394.   HRESULT RemoveItems( 
  395.     [in]                        DWORD        dwCount,
  396.     [in, size_is(dwCount)]      OPCHANDLE  * phServer,
  397.     [out, size_is(,dwCount)]    HRESULT   ** ppErrors
  398.     );
  399.   HRESULT SetActiveState(
  400.     [in]                        DWORD        dwCount,
  401.     [in, size_is(dwCount)]      OPCHANDLE  * phServer,
  402.     [in]                        BOOL         bActive, 
  403.     [out, size_is(,dwCount)]    HRESULT   ** ppErrors
  404.     );
  405.   HRESULT SetClientHandles(
  406.     [in]                        DWORD        dwCount,
  407.     [in, size_is(dwCount)]      OPCHANDLE  * phServer,
  408.     [in, size_is(dwCount)]      OPCHANDLE  * phClient,
  409.     [out, size_is(,dwCount)]    HRESULT   ** ppErrors
  410.     );
  411.   HRESULT SetDatatypes(
  412.     [in]                        DWORD        dwCount,
  413.     [in, size_is(dwCount)]      OPCHANDLE  * phServer,
  414.     [in, size_is(dwCount)]      VARTYPE    * pRequestedDatatypes,
  415.     [out, size_is(,dwCount)]    HRESULT   ** ppErrors
  416.     );
  417.  
  418.   HRESULT CreateEnumerator(
  419.     [in]                REFIID      riid,
  420.     [out, iid_is(riid)] LPUNKNOWN * ppUnk
  421.     );
  422. }
  423. //****************************************************
  424. [
  425.   object,
  426.   uuid(39c13a55-011e-11d0-9675-0020afd8adb3),
  427.   pointer_default(unique)
  428. ]
  429. interface IEnumOPCItemAttributes : IUnknown
  430. {
  431.   HRESULT Next( 
  432.     [in]  ULONG celt,
  433.     [out, size_is(,*pceltFetched)] OPCITEMATTRIBUTES ** ppItemArray,
  434.     [out] ULONG * pceltFetched 
  435.     );
  436.   HRESULT Skip( 
  437.     [in] ULONG celt
  438.     );
  439.   HRESULT Reset( 
  440.     void
  441.     );
  442.   HRESULT Clone( 
  443.     [out] IEnumOPCItemAttributes ** ppEnumItemAttributes
  444.     );
  445. }
  446. // Data Access V2.0 additions
  447. [
  448.   object,
  449.   uuid(39c13a70-011e-11d0-9675-0020afd8adb3),
  450.   pointer_default(unique)
  451. ]
  452. interface IOPCDataCallback : IUnknown
  453. {
  454. HRESULT OnDataChange(
  455.     [in]                 DWORD       dwTransid, 
  456.     [in]                 OPCHANDLE   hGroup, 
  457.     [in]                 HRESULT     hrMasterquality,
  458.     [in]                 HRESULT     hrMastererror,
  459.     [in]                 DWORD       dwCount, 
  460.     [in, size_is(dwCount)] OPCHANDLE * phClientItems, 
  461.     [in, size_is(dwCount)] VARIANT   * pvValues, 
  462.     [in, size_is(dwCount)] WORD      * pwQualities,
  463.     [in, size_is(dwCount)] FILETIME  * pftTimeStamps,
  464.     [in, size_is(dwCount)] HRESULT   * pErrors
  465. );
  466.   HRESULT OnReadComplete(
  467.     [in]                 DWORD       dwTransid, 
  468.     [in]                 OPCHANDLE   hGroup, 
  469.     [in]                 HRESULT     hrMasterquality,
  470.     [in]                 HRESULT     hrMastererror,
  471.     [in]                 DWORD       dwCount, 
  472.     [in, size_is(dwCount)] OPCHANDLE * phClientItems, 
  473.     [in, size_is(dwCount)] VARIANT   * pvValues, 
  474.     [in, size_is(dwCount)] WORD      * pwQualities,
  475.     [in, size_is(dwCount)] FILETIME  * pftTimeStamps,
  476.     [in, size_is(dwCount)] HRESULT   * pErrors
  477. );
  478.   HRESULT OnWriteComplete(
  479.     [in]                 DWORD       dwTransid, 
  480.     [in]                 OPCHANDLE   hGroup, 
  481.     [in]                 HRESULT     hrMastererr, 
  482.     [in]                 DWORD       dwCount, 
  483.     [in, size_is(dwCount)] OPCHANDLE * pClienthandles, 
  484.     [in, size_is(dwCount)] HRESULT   * pErrors
  485. );
  486.   HRESULT OnCancelComplete(
  487.     [in]                 DWORD       dwTransid, 
  488.     [in]                 OPCHANDLE   hGroup
  489. );
  490. }
  491. //****************************************************
  492. [
  493.   object,
  494.   uuid(39c13a71-011e-11d0-9675-0020afd8adb3),
  495.   pointer_default(unique)
  496. ]
  497. interface IOPCAsyncIO2 : IUnknown
  498. {
  499.   HRESULT Read(
  500.     [in]                        DWORD           dwCount,
  501.     [in, size_is(dwCount)]      OPCHANDLE     * phServer,
  502.     [in]                        DWORD           dwTransactionID,
  503.     [out]                       DWORD         * pdwCancelID,
  504.     [out, size_is(,dwCount)]    HRESULT      ** ppErrors
  505.     );
  506.   HRESULT Write(
  507.     [in]                        DWORD           dwCount, 
  508.     [in, size_is(dwCount)]      OPCHANDLE     * phServer,
  509.     [in, size_is(dwCount)]      VARIANT       * pItemValues, 
  510.     [in]                        DWORD           dwTransactionID,
  511.     [out]                       DWORD         * pdwCancelID,
  512.     [out, size_is(,dwCount)]    HRESULT      ** ppErrors
  513.     );
  514.   HRESULT Refresh2(
  515.     [in]                        OPCDATASOURCE   dwSource,
  516.     [in]                        DWORD           dwTransactionID,
  517.     [out]                       DWORD         * pdwCancelID
  518.     );
  519.   HRESULT Cancel2(
  520.     [in]                        DWORD           dwCancelID
  521.     );
  522.   HRESULT SetEnable(
  523.     [in]                        BOOL            bEnable
  524.     );
  525.   HRESULT GetEnable(
  526.     [out]                       BOOL           *pbEnable
  527.     );
  528. }
  529. //****************************************************
  530. [
  531.   object,
  532.   uuid(39c13a72-011e-11d0-9675-0020afd8adb3),
  533.   pointer_default(unique)
  534. ]
  535. interface IOPCItemProperties : IUnknown
  536. {
  537.   HRESULT QueryAvailableProperties ( 
  538.     [in]                          LPWSTR     szItemID,
  539.     [out]                         DWORD    * pdwCount,
  540.     [out, size_is(,*pdwCount)]    DWORD   ** ppPropertyIDs,
  541.     [out, size_is(,*pdwCount)]    LPWSTR  ** ppDescriptions,
  542.     [out, size_is(,*pdwCount)]    VARTYPE ** ppvtDataTypes
  543. );
  544.   HRESULT GetItemProperties ( 
  545.     [in]                         LPWSTR     szItemID,
  546.     [in]                         DWORD      dwCount,
  547.     [in, size_is(dwCount)]       DWORD    * pdwPropertyIDs,
  548.     [out, size_is(,dwCount)]     VARIANT ** ppvData,
  549.     [out, size_is(,dwCount)]     HRESULT ** ppErrors
  550. );
  551.   HRESULT LookupItemIDs( 
  552.     [in]                         LPWSTR     szItemID,
  553.     [in]                         DWORD      dwCount,
  554.     [in, size_is(dwCount)]       DWORD    * pdwPropertyIDs,
  555.     [out, string, size_is(,dwCount)] LPWSTR ** ppszNewItemIDs,
  556.     [out, size_is(,dwCount)]     HRESULT ** ppErrors
  557. );
  558. }
  559. // This TYPELIB is generated as a convenience to users of high level tools
  560. // which are capable of using or browsing TYPELIBs. 
  561. // 'Smart Pointers' in VC5 is one example.
  562. [
  563.     uuid(B28EEDB2-AC6F-11d1-84D5-00608CB8A7E9),
  564.     version(1.0),
  565.     helpstring("OPCDA 2.0 Type Library")
  566. ]
  567. library OPCDA
  568. {
  569.     importlib("stdole32.tlb");
  570.     importlib("stdole2.tlb");
  571.     interface IOPCServer ;
  572.     interface IOPCServerPublicGroups ;
  573.     interface IOPCBrowseServerAddressSpace;
  574.     interface IOPCGroupStateMgt ;
  575.     interface IOPCPublicGroupStateMgt ;
  576.     interface IOPCSyncIO ;
  577.     interface IOPCAsyncIO ;
  578.     interface IOPCItemMgt;
  579.     interface IEnumOPCItemAttributes ;
  580.     interface IOPCDataCallback ;
  581.     interface IOPCAsyncIO2 ;
  582.     interface IOPCItemProperties ;
  583. };