home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / sybase / starbuck / hpp.z / WOLEPOBJ.HPP < prev    next >
C/C++ Source or Header  |  1996-10-18  |  6KB  |  176 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.  * WOleProgrammableObject -- Ole Programmable Object
  14.  *
  15.  *
  16.  *   Events:
  17.  *
  18.  *
  19.  *************************************************************************/
  20.  
  21. #ifndef _WOLEPOBJ_HPP_INCLUDED
  22. #define _WOLEPOBJ_HPP_INCLUDED
  23.  
  24. #ifndef _WNO_PRAGMA_PUSH
  25. #pragma pack(push,8);
  26. #pragma enum int;
  27. #endif
  28.  
  29. #ifndef _WOLEBSTR_HPP_INCLUDED
  30. #   include "wolebstr.hpp"
  31. #endif
  32. #ifndef _WOLEOBJ_HPP_INCLUDED
  33. #   include "woleobj.hpp"
  34. #endif
  35.  
  36. // forward class declarations
  37. class WOleIDispatchHandler;
  38. class WOleEventHandler;
  39.  
  40. // the following is definitions of WOleProgrammableObject
  41.  
  42. class WCMCLASS WOleProgrammableObject : public WEventGenerator {
  43.     WDeclareSubclass( WOleProgrammableObject, WEventGenerator );
  44.  
  45.     public:
  46.  
  47.         /**********************************************************
  48.          * Constructors and Destructors
  49.          *********************************************************/
  50.  
  51.         WOleProgrammableObject();
  52.  
  53.         virtual ~WOleProgrammableObject();
  54.  
  55.     public:
  56.  
  57.         /**************************************************************
  58.          * Properties
  59.          **************************************************************/
  60.  
  61.         // Hot Link
  62.         WBool SetHotLink( WBool set );
  63.         WBool GetHotLink();
  64.  
  65.         // Remote Host
  66.         WBool SetRemoteHost( const WString & remoteHost );
  67.         WString GetRemoteHost() const;
  68.  
  69.         // read-only properties
  70.         WPICursor GetICursor( void ) const;
  71.         WBool GetHasICursor( void ) const;
  72.  
  73.         WBool GetOpened() const;
  74.         WBool GetModified() const;
  75.         WBool GetLinked() const;
  76.  
  77.         WPIUnknown GetObjectInterface() const;
  78.         WString GetObjectClassID() const;
  79.  
  80.         // read-only Licensing properties
  81.         WBool GetLicenseVerified() const;
  82.         WBool GetRuntimeKeyAvailable() const;
  83.         WBString GetRuntimeLicenseKey() const;
  84.  
  85.         // read-only Automation properties
  86.         WOleAutomationErrorInfo GetErrorInfo( void ) const;
  87.         WVariant GetLastResult( void ) const;
  88.         WVarType GetLastResultType( void ) const;
  89.  
  90.         // event notification method
  91.         WBool SetOleEventHandler( WObject *source, WDispIndex disp_index,
  92.                                   WDispID disp_id,
  93.                                   WControlEventHandler handler );
  94.  
  95.         /**************************************************************
  96.          * Methods
  97.          **************************************************************/
  98.  
  99.         // creation, initialization and destruction functions
  100.         WBool Create( const WBString *license=NULL );
  101.         WBool Create( WString const & classID, const WBString *license=NULL );
  102.         WBool CreateLink( WString const & linkSrc, const WBString *license=NULL );
  103.  
  104.         void Destroy();
  105.  
  106.         // Automation methods
  107.  
  108.         // the following will not cause ITypeInfo lookups
  109.         WBool Invoke( WMemberID memberID,
  110.                       WDispatchFlag flag, WUInt cvtParms,
  111.                       WVarType *vtParms, WVarType vtRet,
  112.                       void *result, ... );
  113.  
  114.         WBool Method( WMemberID memberID,
  115.                       WUInt cvtParms, WVarType *vtParms,
  116.                       WVarType vtRet, void *result, ... );
  117.  
  118.         WBool PropertyGet( WMemberID memberID, WVarType vtRet, void *result );
  119.         WBool PropertyPut( WMemberID memberID, WVarType vt, ... );
  120.         WBool PropertyPutRef( WMemberID memberID, WVarType vt, ... );
  121.  
  122.         WBool IDofName( const WString & name, WMemberID & id );
  123.  
  124.         // the following may cause ITypeInfo lookups
  125.         WBool Invoke( WMemberID memberID,
  126.                       WDispatchFlag flag, WVarType vtRet,
  127.                       void *result, const WOleParmList & parmlist );
  128.  
  129.         // object linking methods
  130.         WBool UpdateLink( void );
  131.  
  132.         // other methods
  133.         void FreezeControlEvents( WBool freeze );
  134.  
  135.         /**************************************************************
  136.          * Operators
  137.          **************************************************************/
  138.  
  139.         operator WPIUnknown() const;
  140.         operator WPIDispatch() const;
  141.  
  142.         /**************************************************************
  143.          * Internal members
  144.          **************************************************************/
  145.  
  146.     private:
  147.         virtual const WChar * GetRegisteredClass();
  148.  
  149.     /**********************************************************
  150.      * Data Members
  151.      *********************************************************/
  152.     
  153.     protected:
  154.         WOleIDispatchHandler    *_idispHandler;
  155.         WOleEventHandler        *_eventHandler;
  156.         WPIUnknown              _pIUnknown;
  157.         WString                 _progID;
  158.         WString                 _classID;
  159.         WBool                   _isLinked;
  160.         WBool                   _hotLink;
  161.         WBool                   _runTimeKeyAvail;
  162.         WBool                   _licVerified;
  163.         WBStr                   _licenseKey;
  164.         unsigned long           _cacheConnection;
  165.         WString                 _remoteHost;
  166.  
  167. };
  168.  
  169. #ifndef _WNO_PRAGMA_PUSH
  170. #pragma enum pop;
  171. #pragma pack(pop);
  172. #endif
  173.  
  174. #endif // _WOLEPOBJ_HPP_INCLUDED
  175.  
  176.