/******************************************************************************* Copyright (c) 2003, Robert Cowham and Vaccaperna Systems Ltd. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL VACCAPERNA SYSTEMS LTD. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ /******************************************************************************* * Name: p4.cpp * * Author: Robert Cowham <robert@vaccaperna.co.uk> * * Description: * Implementation of p4 - the COM class and thus external interface. * ******************************************************************************/ #ifndef __P4_H_ #define __P4_H_ #include "resource.h" // main symbols #include "p4interface.h" #include "p4clientapi.h" #include "OleType.h" ///////////////////////////////////////////////////////////////////////////// // p4 class ATL_NO_VTABLE p4 : public CComObjectRootEx<CComSingleThreadModel>, public CComCoClass<p4, &CLSID_p4>, public ISupportErrorInfo, public IDispatchImpl<Ip4, &IID_Ip4, &LIBID_P4COMLib> { public: p4() { m_Initialized = False; m_emptyString = ""; } DECLARE_REGISTRY_RESOURCEID(IDR_P4) DECLARE_PROTECT_FINAL_CONSTRUCT() BEGIN_COM_MAP(p4) COM_INTERFACE_ENTRY(Ip4) COM_INTERFACE_ENTRY(IDispatch) COM_INTERFACE_ENTRY(ISupportErrorInfo) END_COM_MAP() // Ip4 public: STDMETHOD(get_ArrayVar)(BSTR varName, /*[out, retval]*/ SAFEARRAY ** valArray); STDMETHOD(put_ArrayVar)(BSTR varName, /*[in]*/ SAFEARRAY ** valArray); STDMETHOD(get_VarExists)(BSTR varName, /*[out, retval]*/ BOOL *pVal); STDMETHOD(get_Var)(BSTR varName, /*[out, retval]*/ BSTR *pVal); STDMETHOD(put_Var)(BSTR varName, /*[in]*/ BSTR newVal); STDMETHOD(get_TempFilename)(/*[out, retval]*/ BSTR *pVal); STDMETHOD(Tagged)(); STDMETHOD(ParseForms)(); STDMETHOD(get_ExceptionLevel)(/*[out, retval]*/ long *pVal); STDMETHOD(put_ExceptionLevel)(/*[in]*/ long newVal); STDMETHOD(Disconnect)(); STDMETHOD(Connect)(); STDMETHODIMP InterfaceSupportsErrorInfo(REFIID riid); STDMETHOD(get_Warnings)(/*[out, retval]*/ SAFEARRAY ** valArray); STDMETHOD(get_Errors)(/*[out, retval]*/ SAFEARRAY ** valArray); STDMETHOD(get_run)(/*[in]*/ BSTR cmd, /*[out, retval]*/ SAFEARRAY ** valArray); STDMETHOD(get_Charset)(/*[out, retval]*/ BSTR *pVal); STDMETHOD(put_Charset)(/*[in]*/ BSTR newVal); STDMETHOD(get_Client)(/*[out, retval]*/ BSTR *pVal); STDMETHOD(put_Client)(/*[in]*/ BSTR newVal); STDMETHOD(get_Cwd)(/*[out, retval]*/ BSTR *pVal); STDMETHOD(put_Cwd)(/*[in]*/ BSTR newVal); STDMETHOD(get_Host)(/*[out, retval]*/ BSTR *pVal); STDMETHOD(put_Host)(/*[in]*/ BSTR newVal); STDMETHOD(get_Language)(/*[out, retval]*/ BSTR *pVal); STDMETHOD(put_Language)(/*[in]*/ BSTR newVal); STDMETHOD(get_Password)(/*[out, retval]*/ BSTR *pVal); STDMETHOD(put_Password)(/*[in]*/ BSTR newVal); STDMETHOD(get_Port)(/*[out, retval]*/ BSTR *pVal); STDMETHOD(put_Port)(/*[in]*/ BSTR newVal); STDMETHOD(get_User)(/*[out, retval]*/ BSTR *pVal); STDMETHOD(put_User)(/*[in]*/ BSTR newVal); private: ArrayString* CheckEmptyArray(SAFEARRAY **arr); String CheckEmptyString(BSTR newVal); Boolean m_Initialized; p4ClientApi m_client; String m_emptyString; ArrayString m_emptyArray; ArrayString m_array; }; #endif //__P4_H_
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#9 | 9835 | Robert Cowham | Added SetProtocolV | ||
#8 | 7459 | Robert Cowham | Add SetTicketFile option | ||
#7 | 6050 | Robert Cowham |
- Use P4API 2007.2 - Added SetProg, SetVersion, SetProtocol and GetProtocol |
||
#6 | 5194 | Robert Cowham |
Changes (2005.1.0.0) Added Dropped() to detect dropped connections Added Input property to provide input e.g. for passwords Added FormatDateTime() as a convenience for calling C Runtime function (for VB use) Imported changes from p4ofc which made it more reliable. |
||
#5 | 4156 | Robert Cowham | Updated to support Variant Arrays (as required by VBScript). | ||
#4 | 3612 | Robert Cowham |
Version 1.0.0.2 New interface for ServerVersion. New put property ArrayVarVar which is the same as ArrayVar but takes an Array of Variants rather than strings (for Lisp compatibility!). |
||
#3 | 3561 | Robert Cowham | Renamed P4COMLib to P4COM and run from property to method. | ||
#2 | 3542 | Robert Cowham | Update to use exceptions properly - including examples. | ||
#1 | 3525 | Robert Cowham | Initial release |