home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 October / Chip_1997-10_cd.bin / tema / sybase / powerj / hpp.z / WDSPHLPR.HPP < prev    next >
C/C++ Source or Header  |  1996-10-18  |  6KB  |  175 lines

  1. /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2.    %     Copyright (C) 1994, by WATCOM International Inc.  All rights    %
  3.    %     reserved.  No part of this software may be reproduced or        %
  4.    %     used in any form or by any means - graphic, electronic or       %
  5.    %     mechanical, including photocopying, recording, taping or        %
  6.    %     information storage and retrieval systems - except with the     %
  7.    %     written permission of WATCOM International Inc.                 %
  8.    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  9. */
  10.  
  11. /*************************************************************************
  12.  *
  13.  * WOleDispatchHelper -- Dispatch Interface Helper class
  14.  *
  15.  *
  16.  *   Events:
  17.  *
  18.  *
  19.  *************************************************************************/
  20.  
  21. #ifndef _WDSPHLPR_HPP_INCLUDED
  22. #define _WDSPHLPR_HPP_INCLUDED
  23.  
  24. #ifndef _WNO_PRAGMA_PUSH
  25. #pragma pack(push,8);
  26. #pragma enum int;
  27. #endif
  28.  
  29. #ifndef _WOLEAUTO_HPP_INCLUDED
  30. #   include "woleauto.hpp"
  31. #endif
  32.  
  33. #ifndef _WDEF_HPP_INCLUDED
  34. #   include "wdef.hpp"
  35. #endif
  36. #ifndef _WOLEDEF_HPP_INCLUDED
  37. #   include "woledef.hpp"
  38. #endif
  39. #ifndef _WOLEPARM_HPP_INCLUDED
  40. #   include "woleparm.hpp"
  41. #endif
  42.  
  43. // forward class declarations
  44. class WCMCLASS WOleInvokeHelper;
  45.  
  46. class WCMCLASS WOleAutomationErrorInfo {
  47.  
  48.     public:
  49.  
  50.     /**********************************************************
  51.      * Constructors and Destructors
  52.      *********************************************************/
  53.  
  54.         WOleAutomationErrorInfo();
  55.         WOleAutomationErrorInfo( const WOleAutomationErrorInfo & info );
  56.  
  57.         ~WOleAutomationErrorInfo();
  58.  
  59.     /**************************************************************
  60.      * Methods
  61.      **************************************************************/
  62.  
  63.         void Display( void );
  64.  
  65.     /**********************************************************
  66.      * Operators
  67.      *********************************************************/
  68.     
  69.         WOleAutomationErrorInfo & operator=( const WOleAutomationErrorInfo & info );
  70.  
  71.     /**********************************************************
  72.      * Data Members
  73.      *********************************************************/
  74.  
  75.     public:
  76.         WInvokeError    error;
  77.         WExceptionInfo  exception;
  78.         WUInt           argError;
  79.         WHRESULT        hresult;;
  80.  
  81. };
  82.  
  83. class WCMCLASS WOleDispatchHelper : public WObject {
  84.     WDeclareSubclass( WOleDispatchHelper, WObject );
  85.  
  86.     public:
  87.  
  88.         /**********************************************************
  89.          * Constructors and Destructors
  90.          *********************************************************/
  91.  
  92.         WOleDispatchHelper( void );
  93.  
  94.         WOleDispatchHelper( WPIDispatch pIDispatch,
  95.                             WBool release=TRUE,
  96.                             WBool initMembers=FALSE );
  97.  
  98.         WOleDispatchHelper( WPIUnknown pIUnknown,
  99.                             WBool release=TRUE,
  100.                             WBool initMembers=FALSE );
  101.  
  102.         virtual ~WOleDispatchHelper();
  103.  
  104.     public:
  105.  
  106.         /**************************************************************
  107.          * Properties
  108.          **************************************************************/
  109.  
  110.         // read-only Automation properties
  111.         WPIDispatch GetDispatchInterface( void ) const;
  112.         WOleAutomationErrorInfo GetErrorInfo( void ) const;
  113.  
  114.         WVariant GetLastResult( void ) const;
  115.         WVarType GetLastResultType( void ) const;
  116.  
  117.         /**************************************************************
  118.          * Methods
  119.          **************************************************************/
  120.  
  121.         WBool Create( WPIDispatch pIDispatch, WBool release=TRUE,
  122.                       WBool initMembers=FALSE );
  123.         WBool Create( WPIUnknown pIUnknown, WBool release=TRUE,
  124.                       WBool initMembers=FALSE );
  125.         WBool Destroy( void );
  126.  
  127.         void ClearErrorInfo( void );
  128.  
  129.         // Automation methods
  130.  
  131.         // the following will not cause ITypeInfo lookups
  132.         WBool Invoke( WMemberID memberID, WDispatchFlag flag,
  133.                       WUInt cvtParms, WVarType *vtParms,
  134.                       WVarType vtRet,
  135.                       void *result, ... );
  136.  
  137.         WBool Method( WMemberID memberID,
  138.                       WUInt cvtParms, WVarType *vtParms,
  139.                       WVarType vtRet, void *result, ... );
  140.  
  141.         WBool PropertyGet( WMemberID memberID, WVarType vtRet, void *result );
  142.         WBool PropertyPut( WMemberID memberID, WVarType vt, ... );
  143.         WBool PropertyPutRef( WMemberID memberID, WVarType vt, ... );
  144.  
  145.         WBool IDofName( const WString & name, WMemberID & id );
  146.  
  147.         // the following may cause ITypeInfo lookups
  148.         WBool Invoke( WMemberID memberID, WDispatchFlag flag,
  149.                       WVarType vtRet, void *result,
  150.                       const WOleParmList & parmlist );
  151.  
  152.         /**************************************************************
  153.          * Operators
  154.          **************************************************************/
  155.  
  156.         operator WPIUnknown() const;
  157.         operator WPIDispatch() const;
  158.  
  159.     /**********************************************************
  160.      * Data Members
  161.      *********************************************************/
  162.     
  163.     protected:
  164.         WOleInvokeHelper        *_inv_helper;
  165.  
  166. };
  167.  
  168. #ifndef _WNO_PRAGMA_PUSH
  169. #pragma enum pop;
  170. #pragma pack(pop);
  171. #endif
  172.  
  173. #endif // _WDSPHLPR_HPP_INCLUDED
  174.  
  175.