Recovered from cvs revision 2007-05-01 07:40:00
This commit is contained in:
1395
ase/com/Awk.cpp
Normal file
1395
ase/com/Awk.cpp
Normal file
File diff suppressed because it is too large
Load Diff
171
ase/com/Awk.h
Normal file
171
ase/com/Awk.h
Normal file
@ -0,0 +1,171 @@
|
||||
/*
|
||||
* $Id: Awk.h,v 1.3 2007/04/30 06:04:43 bacon Exp $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#ifndef _ASE_COM_AWK_H_
|
||||
#define _ASE_COM_AWK_H_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "resource.h"
|
||||
#include "asecom.h"
|
||||
#include <ase/awk/awk.h>
|
||||
#include <ase/awk/val.h>
|
||||
#include "awk_cp.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAwk
|
||||
|
||||
class CAwk :
|
||||
public IDispatchImpl<IAwk, &IID_IAwk, &LIBID_ASECOM>,
|
||||
public ISupportErrorInfo,
|
||||
/*public CComObjectRoot,*/
|
||||
public CComObjectRootEx<CComSingleThreadModel>,
|
||||
public CComCoClass<CAwk,&CLSID_Awk>,
|
||||
public IConnectionPointContainerImpl<CAwk>,
|
||||
public IProvideClassInfo2Impl<&CLSID_Awk, &DIID_IAwkEvents, &LIBID_ASECOM>,
|
||||
public CProxyIAwkEvents< CAwk >
|
||||
|
||||
{
|
||||
public:
|
||||
ase_awk_t* handle;
|
||||
int option;
|
||||
int errnum;
|
||||
ase_size_t errlin;
|
||||
ase_char_t errmsg[256];
|
||||
|
||||
struct
|
||||
{
|
||||
struct
|
||||
{
|
||||
int parse;
|
||||
int run;
|
||||
} block;
|
||||
struct
|
||||
{
|
||||
int parse;
|
||||
int run;
|
||||
} expr;
|
||||
struct
|
||||
{
|
||||
int build;
|
||||
int match;
|
||||
} rex;
|
||||
} max_depth;
|
||||
|
||||
IBuffer* read_src_buf;
|
||||
IBuffer* write_src_buf;
|
||||
ase_size_t read_src_pos;
|
||||
ase_size_t read_src_len;
|
||||
|
||||
IBuffer* write_extio_buf;
|
||||
|
||||
struct bfn_t
|
||||
{
|
||||
struct
|
||||
{
|
||||
TCHAR* ptr;
|
||||
size_t len;
|
||||
} name;
|
||||
size_t min_args;
|
||||
size_t max_args;
|
||||
struct bfn_t* next;
|
||||
} * bfn_list;
|
||||
|
||||
BSTR entry_point;
|
||||
VARIANT_BOOL debug;
|
||||
VARIANT_BOOL use_longlong;
|
||||
public:
|
||||
CAwk();
|
||||
~CAwk ();
|
||||
|
||||
BEGIN_COM_MAP(CAwk)
|
||||
COM_INTERFACE_ENTRY(IDispatch)
|
||||
COM_INTERFACE_ENTRY(IAwk)
|
||||
COM_INTERFACE_ENTRY(ISupportErrorInfo)
|
||||
COM_INTERFACE_ENTRY_IMPL(IConnectionPointContainer)
|
||||
COM_INTERFACE_ENTRY(IProvideClassInfo)
|
||||
COM_INTERFACE_ENTRY(IProvideClassInfo2)
|
||||
END_COM_MAP()
|
||||
|
||||
BEGIN_CONNECTION_POINT_MAP(CAwk)
|
||||
CONNECTION_POINT_ENTRY(DIID_IAwkEvents)
|
||||
END_CONNECTION_POINT_MAP()
|
||||
|
||||
//DECLARE_NOT_AGGREGATABLE(CAwk)
|
||||
// Remove the comment from the line above if you don't want your object to
|
||||
// support aggregation.
|
||||
|
||||
DECLARE_REGISTRY_RESOURCEID(IDR_AWK)
|
||||
// ISupportsErrorInfo
|
||||
STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
|
||||
|
||||
// IAwk
|
||||
public:
|
||||
STDMETHOD(get_UseLongLong)(/*[out, retval]*/ VARIANT_BOOL *pVal);
|
||||
STDMETHOD(put_UseLongLong)(/*[in]*/ VARIANT_BOOL newVal);
|
||||
STDMETHOD(get_Debug)(/*[out, retval]*/ VARIANT_BOOL *pVal);
|
||||
STDMETHOD(put_Debug)(/*[in]*/ VARIANT_BOOL newVal);
|
||||
STDMETHOD(get_EntryPoint)(/*[out, retval]*/ BSTR *pVal);
|
||||
STDMETHOD(put_EntryPoint)(/*[in]*/ BSTR newVal);
|
||||
STDMETHOD(get_MaxDepthForRexMatch)(/*[out, retval]*/ int *pVal);
|
||||
STDMETHOD(put_MaxDepthForRexMatch)(/*[in]*/ int newVal);
|
||||
STDMETHOD(get_MaxDepthForRexBuild)(/*[out, retval]*/ int *pVal);
|
||||
STDMETHOD(put_MaxDepthForRexBuild)(/*[in]*/ int newVal);
|
||||
STDMETHOD(get_MaxDepthForExprRun)(/*[out, retval]*/ int *pVal);
|
||||
STDMETHOD(put_MaxDepthForExprRun)(/*[in]*/ int newVal);
|
||||
STDMETHOD(get_MaxDepthForExprParse)(/*[out, retval]*/ int *pVal);
|
||||
STDMETHOD(put_MaxDepthForExprParse)(/*[in]*/ int newVal);
|
||||
STDMETHOD(get_MaxDepthForBlockRun)(/*[out, retval]*/ int *pVal);
|
||||
STDMETHOD(put_MaxDepthForBlockRun)(/*[in]*/ int newVal);
|
||||
STDMETHOD(get_MaxDepthForBlockParse)(/*[out, retval]*/ int *pVal);
|
||||
STDMETHOD(put_MaxDepthForBlockParse)(/*[in]*/ int newVal);
|
||||
STDMETHOD(get_ArgumentsToEntryPoint)(/*[out, retval]*/ VARIANT_BOOL *pVal);
|
||||
STDMETHOD(put_ArgumentsToEntryPoint)(/*[in]*/ VARIANT_BOOL newVal);
|
||||
STDMETHOD(get_UseCrlf)(/*[out, retval]*/ VARIANT_BOOL *pVal);
|
||||
STDMETHOD(put_UseCrlf)(/*[in]*/ VARIANT_BOOL newVal);
|
||||
STDMETHOD(get_Nextofile)(/*[out, retval]*/ VARIANT_BOOL *pVal);
|
||||
STDMETHOD(put_Nextofile)(/*[in]*/ VARIANT_BOOL newVal);
|
||||
STDMETHOD(get_StripSpaces)(/*[out, retval]*/ VARIANT_BOOL *pVal);
|
||||
STDMETHOD(put_StripSpaces)(/*[in]*/ VARIANT_BOOL newVal);
|
||||
STDMETHOD(get_StringBaseOne)(/*[out, retval]*/ VARIANT_BOOL *pVal);
|
||||
STDMETHOD(put_StringBaseOne)(/*[in]*/ VARIANT_BOOL newVal);
|
||||
STDMETHOD(get_SupportBlockless)(/*[out, retval]*/ VARIANT_BOOL *pVal);
|
||||
STDMETHOD(put_SupportBlockless)(/*[in]*/ VARIANT_BOOL newVal);
|
||||
STDMETHOD(get_SupportExtio)(/*[out, retval]*/ VARIANT_BOOL *pVal);
|
||||
STDMETHOD(put_SupportExtio)(/*[in]*/ VARIANT_BOOL newVal);
|
||||
STDMETHOD(get_ConcatString)(/*[out, retval]*/ VARIANT_BOOL *pVal);
|
||||
STDMETHOD(put_ConcatString)(/*[in]*/ VARIANT_BOOL newVal);
|
||||
STDMETHOD(get_IdivOperator)(/*[out, retval]*/ VARIANT_BOOL *pVal);
|
||||
STDMETHOD(put_IdivOperator)(/*[in]*/ VARIANT_BOOL newVal);
|
||||
STDMETHOD(get_ShiftOperators)(/*[out, retval]*/ VARIANT_BOOL *pVal);
|
||||
STDMETHOD(put_ShiftOperators)(/*[in]*/ VARIANT_BOOL newVal);
|
||||
STDMETHOD(get_VariableShading)(/*[out, retval]*/ VARIANT_BOOL *pVal);
|
||||
STDMETHOD(put_VariableShading)(/*[in]*/ VARIANT_BOOL newVal);
|
||||
STDMETHOD(get_UniqueFunction)(/*[out, retval]*/ VARIANT_BOOL *pVal);
|
||||
STDMETHOD(put_UniqueFunction)(/*[in]*/ VARIANT_BOOL newVal);
|
||||
STDMETHOD(get_ExplicitVariable)(/*[out, retval]*/ VARIANT_BOOL *pVal);
|
||||
STDMETHOD(put_ExplicitVariable)(/*[in]*/ VARIANT_BOOL newVal);
|
||||
STDMETHOD(get_ImplicitVariable)(/*[out, retval]*/ VARIANT_BOOL *pVal);
|
||||
STDMETHOD(put_ImplicitVariable)(/*[in]*/ VARIANT_BOOL newVal);
|
||||
STDMETHOD(get_ErrorMessage)(/*[out, retval]*/ BSTR *pVal);
|
||||
STDMETHOD(get_ErrorLine)(/*[out, retval]*/ int *pVal);
|
||||
STDMETHOD(get_ErrorCode)(/*[out, retval]*/ int *pVal);
|
||||
|
||||
|
||||
HRESULT __stdcall DeleteFunction (
|
||||
/*[in]*/ BSTR name, /*[out, retval]*/ VARIANT_BOOL* ret);
|
||||
HRESULT __stdcall AddFunction (
|
||||
/*[in]*/ BSTR name, /*[in]*/ int minArgs,
|
||||
/*[in]*/ int maxArgs, /*[out, retval]*/ VARIANT_BOOL* ret);
|
||||
|
||||
HRESULT __stdcall Parse (/*[out, retval]*/ VARIANT_BOOL* ret);
|
||||
HRESULT __stdcall Run (
|
||||
/*[in]*/ VARIANT argarray, /*[out, retval]*/ VARIANT_BOOL* ret);
|
||||
};
|
||||
|
||||
#endif
|
25
ase/com/Awk.rgs
Normal file
25
ase/com/Awk.rgs
Normal file
@ -0,0 +1,25 @@
|
||||
HKCR
|
||||
{
|
||||
ASE.Awk.1 = s 'ASE Awk Class'
|
||||
{
|
||||
CLSID = s '{AD863B53-F5EC-45C3-8B1C-6AC678227DC8}'
|
||||
}
|
||||
ASE.Awk = s 'ASE Awk Class'
|
||||
{
|
||||
CLSID = s '{AD863B53-F5EC-45C3-8B1C-6AC678227DC8}'
|
||||
}
|
||||
NoRemove CLSID
|
||||
{
|
||||
ForceRemove {AD863B53-F5EC-45C3-8B1C-6AC678227DC8} = s 'ASE Awk Class'
|
||||
{
|
||||
ProgID = s 'ASE.Awk.1'
|
||||
VersionIndependentProgID = s 'ASE.Awk'
|
||||
ForceRemove 'Programmable'
|
||||
InprocServer32 = s '%MODULE%'
|
||||
{
|
||||
val ThreadingModel = s 'Apartment'
|
||||
}
|
||||
'TypeLib' = s '{F9C69806-16A1-4162-998A-876B33C470BF}'
|
||||
}
|
||||
}
|
||||
}
|
70
ase/com/AwkExtio.cpp
Normal file
70
ase/com/AwkExtio.cpp
Normal file
@ -0,0 +1,70 @@
|
||||
/*
|
||||
* $Id: AwkExtio.cpp,v 1.3 2007/04/30 06:04:43 bacon Exp $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "asecom.h"
|
||||
#include "AwkExtio.h"
|
||||
|
||||
#include <stdio.h>
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAwkExtio
|
||||
|
||||
CAwkExtio::CAwkExtio (): name (NULL)
|
||||
{
|
||||
VariantInit (&handle);
|
||||
}
|
||||
|
||||
CAwkExtio::~CAwkExtio ()
|
||||
{
|
||||
if (name != NULL) SysFreeString (name);
|
||||
VariantClear (&handle);
|
||||
}
|
||||
|
||||
STDMETHODIMP CAwkExtio::get_Name (BSTR *pVal)
|
||||
{
|
||||
if (name == NULL) *pVal = name;
|
||||
else
|
||||
{
|
||||
BSTR tmp = SysAllocStringLen (name, SysStringLen(name));
|
||||
if (tmp == NULL) return E_OUTOFMEMORY;
|
||||
*pVal = tmp;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
BOOL CAwkExtio::PutName (const TCHAR* val)
|
||||
{
|
||||
if (name != NULL) SysFreeString (name);
|
||||
name = SysAllocString (val);
|
||||
return (name == NULL)? FALSE: TRUE;
|
||||
}
|
||||
|
||||
STDMETHODIMP CAwkExtio::get_Type(AwkExtioType *pVal)
|
||||
{
|
||||
*pVal = type;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CAwkExtio::get_Mode(AwkExtioMode *pVal)
|
||||
{
|
||||
*pVal = mode;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CAwkExtio::get_Handle (VARIANT *pVal)
|
||||
{
|
||||
VariantClear (pVal);
|
||||
VariantCopy (pVal, &handle);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CAwkExtio::put_Handle (VARIANT newVal)
|
||||
{
|
||||
VariantClear (&handle);
|
||||
VariantCopy (&handle, &newVal);
|
||||
return S_OK;
|
||||
}
|
53
ase/com/AwkExtio.h
Normal file
53
ase/com/AwkExtio.h
Normal file
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* $Id: AwkExtio.h,v 1.3 2007/04/30 06:04:43 bacon Exp $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#ifndef _ASE_COM_AWKEXTIO_H_
|
||||
#define _ASE_COM_AWKEXTIO_H_
|
||||
|
||||
#include "resource.h"
|
||||
#include <ase/awk/awk.h>
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAwkExtio
|
||||
class ATL_NO_VTABLE CAwkExtio :
|
||||
public CComObjectRootEx<CComSingleThreadModel>,
|
||||
public CComCoClass<CAwkExtio, &CLSID_AwkExtio>,
|
||||
public IDispatchImpl<IAwkExtio, &IID_IAwkExtio, &LIBID_ASECOM>
|
||||
{
|
||||
public:
|
||||
BSTR name;
|
||||
AwkExtioType type;
|
||||
AwkExtioMode mode;
|
||||
VARIANT handle;
|
||||
|
||||
IBuffer* read_buf;
|
||||
ase_size_t read_buf_pos;
|
||||
ase_size_t read_buf_len;
|
||||
|
||||
BOOL PutName (const TCHAR* val);
|
||||
|
||||
CAwkExtio ();
|
||||
~CAwkExtio ();
|
||||
|
||||
DECLARE_REGISTRY_RESOURCEID(IDR_AWKEXTIO)
|
||||
|
||||
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
||||
|
||||
BEGIN_COM_MAP(CAwkExtio)
|
||||
COM_INTERFACE_ENTRY(IAwkExtio)
|
||||
COM_INTERFACE_ENTRY(IDispatch)
|
||||
END_COM_MAP()
|
||||
|
||||
// IAwkExtio
|
||||
public:
|
||||
STDMETHOD(get_Handle)(/*[out, retval]*/ VARIANT *pVal);
|
||||
STDMETHOD(put_Handle)(/*[in]*/ VARIANT newVal);
|
||||
STDMETHOD(get_Mode)(/*[out, retval]*/ AwkExtioMode *pVal);
|
||||
STDMETHOD(get_Type)(/*[out, retval]*/ AwkExtioType *pVal);
|
||||
STDMETHOD(get_Name)(/*[out, retval]*/ BSTR *pVal);
|
||||
};
|
||||
|
||||
#endif //__AWKEXTIO_H_
|
26
ase/com/AwkExtio.rgs
Normal file
26
ase/com/AwkExtio.rgs
Normal file
@ -0,0 +1,26 @@
|
||||
HKCR
|
||||
{
|
||||
ASE.AwkExtio.1 = s 'ASE AwkExtio Class'
|
||||
{
|
||||
CLSID = s '{F52F065A-5FD4-4F4D-AFEA-F5E446B16383}'
|
||||
}
|
||||
ASE.AwkExtio = s 'ASE AwkExtio Class'
|
||||
{
|
||||
CLSID = s '{F52F065A-5FD4-4F4D-AFEA-F5E446B16383}'
|
||||
CurVer = s 'ASE.AwkExtio.1'
|
||||
}
|
||||
NoRemove CLSID
|
||||
{
|
||||
ForceRemove {F52F065A-5FD4-4F4D-AFEA-F5E446B16383} = s 'ASE AwkExtio Class'
|
||||
{
|
||||
ProgID = s 'ASE.AwkExtio.1'
|
||||
VersionIndependentProgID = s 'ASE.AwkExtio'
|
||||
ForceRemove 'Programmable'
|
||||
InprocServer32 = s '%MODULE%'
|
||||
{
|
||||
val ThreadingModel = s 'Apartment'
|
||||
}
|
||||
'TypeLib' = s '{F9C69806-16A1-4162-998A-876B33C470BF}'
|
||||
}
|
||||
}
|
||||
}
|
51
ase/com/Buffer.cpp
Normal file
51
ase/com/Buffer.cpp
Normal file
@ -0,0 +1,51 @@
|
||||
/*
|
||||
* $Id: Buffer.cpp,v 1.3 2007/04/30 06:04:43 bacon Exp $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Buffer.h"
|
||||
|
||||
CBuffer::CBuffer ()
|
||||
{
|
||||
str = NULL;
|
||||
}
|
||||
|
||||
CBuffer::~CBuffer ()
|
||||
{
|
||||
if (str != NULL) SysFreeString (str);
|
||||
}
|
||||
|
||||
STDMETHODIMP CBuffer::get_Value (BSTR *pVal)
|
||||
{
|
||||
if (str == NULL) *pVal = NULL;
|
||||
else
|
||||
{
|
||||
BSTR tmp = SysAllocStringLen(str, SysStringLen(str));
|
||||
if (tmp == NULL) return E_OUTOFMEMORY;
|
||||
*pVal = tmp;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CBuffer::put_Value (BSTR newVal)
|
||||
{
|
||||
if (str != NULL) SysFreeString (str);
|
||||
if (newVal == NULL) str = newVal;
|
||||
else
|
||||
{
|
||||
str = SysAllocStringLen (newVal, SysStringLen(newVal));
|
||||
if (str == NULL) return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
BOOL CBuffer::PutValue (const TCHAR* val, SIZE_T len)
|
||||
{
|
||||
if (str != NULL) SysFreeString (str);
|
||||
str = SysAllocStringLen (val, len);
|
||||
return (str == NULL)? FALSE: TRUE;
|
||||
}
|
40
ase/com/Buffer.h
Normal file
40
ase/com/Buffer.h
Normal file
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* $Id: Buffer.h,v 1.3 2007/04/30 06:04:43 bacon Exp $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#ifndef _ASE_COM_BUFFER_H_
|
||||
#define _ASE_COM_BUFFER_H_
|
||||
|
||||
#include "resource.h"
|
||||
#include "asecom.h"
|
||||
|
||||
class ATL_NO_VTABLE CBuffer :
|
||||
public CComObjectRootEx<CComSingleThreadModel>,
|
||||
public CComCoClass<CBuffer, &CLSID_Buffer>,
|
||||
public IDispatchImpl<IBuffer, &IID_IBuffer, &LIBID_ASECOM>
|
||||
{
|
||||
public:
|
||||
BSTR str;
|
||||
BOOL PutValue (const TCHAR* val, SIZE_T len);
|
||||
|
||||
public:
|
||||
CBuffer ();
|
||||
~CBuffer ();
|
||||
|
||||
DECLARE_REGISTRY_RESOURCEID(IDR_BUFFER)
|
||||
|
||||
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
||||
|
||||
BEGIN_COM_MAP(CBuffer)
|
||||
COM_INTERFACE_ENTRY(IBuffer)
|
||||
COM_INTERFACE_ENTRY(IDispatch)
|
||||
END_COM_MAP()
|
||||
|
||||
public:
|
||||
STDMETHOD(get_Value)(/*[out, retval]*/ BSTR *pVal);
|
||||
STDMETHOD(put_Value)(/*[in]*/ BSTR newVal);
|
||||
};
|
||||
|
||||
#endif
|
26
ase/com/Buffer.rgs
Normal file
26
ase/com/Buffer.rgs
Normal file
@ -0,0 +1,26 @@
|
||||
HKCR
|
||||
{
|
||||
ASE.Buffer.1 = s 'ASE Buffer Class'
|
||||
{
|
||||
CLSID = s '{866B79A7-7628-4808-8AE7-784BE2491C80}'
|
||||
}
|
||||
ASE.Buffer = s 'ASE Buffer Class'
|
||||
{
|
||||
CLSID = s '{866B79A7-7628-4808-8AE7-784BE2491C80}'
|
||||
CurVer = s 'ASE.Buffer.1'
|
||||
}
|
||||
NoRemove CLSID
|
||||
{
|
||||
ForceRemove {866B79A7-7628-4808-8AE7-784BE2491C80} = s 'ASE Buffer Class'
|
||||
{
|
||||
ProgID = s 'ASE.Buffer.1'
|
||||
VersionIndependentProgID = s 'ASE.Buffer'
|
||||
ForceRemove 'Programmable'
|
||||
InprocServer32 = s '%MODULE%'
|
||||
{
|
||||
val ThreadingModel = s 'Apartment'
|
||||
}
|
||||
'TypeLib' = s '{F9C69806-16A1-4162-998A-876B33C470BF}'
|
||||
}
|
||||
}
|
||||
}
|
78
ase/com/asecom.cpp
Normal file
78
ase/com/asecom.cpp
Normal file
@ -0,0 +1,78 @@
|
||||
/*
|
||||
* $Id: asecom.cpp,v 1.3 2007/04/30 06:04:43 bacon Exp $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
// Note: Proxy/Stub Information
|
||||
// To build a separate proxy/stub DLL,
|
||||
// run nmake -f aseps.mk in the project directory.
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "resource.h"
|
||||
#include <initguid.h>
|
||||
#include "asecom.h"
|
||||
|
||||
#include "asecom_i.c"
|
||||
#include "Awk.h"
|
||||
#include "Buffer.h"
|
||||
#include "AwkExtio.h"
|
||||
|
||||
CComModule _Module;
|
||||
|
||||
BEGIN_OBJECT_MAP(ObjectMap)
|
||||
OBJECT_ENTRY(CLSID_Awk, CAwk)
|
||||
OBJECT_ENTRY(CLSID_Buffer, CBuffer)
|
||||
OBJECT_ENTRY(CLSID_AwkExtio, CAwkExtio)
|
||||
END_OBJECT_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// DLL Entry Point
|
||||
|
||||
extern "C"
|
||||
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
|
||||
{
|
||||
if (dwReason == DLL_PROCESS_ATTACH)
|
||||
{
|
||||
_Module.Init(ObjectMap, hInstance, &LIBID_ASECOM);
|
||||
DisableThreadLibraryCalls(hInstance);
|
||||
}
|
||||
else if (dwReason == DLL_PROCESS_DETACH)
|
||||
_Module.Term();
|
||||
return TRUE; // ok
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Used to determine whether the DLL can be unloaded by OLE
|
||||
|
||||
STDAPI DllCanUnloadNow(void)
|
||||
{
|
||||
return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Returns a class factory to create an object of the requested type
|
||||
|
||||
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
|
||||
{
|
||||
return _Module.GetClassObject(rclsid, riid, ppv);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// DllRegisterServer - Adds entries to the system registry
|
||||
|
||||
STDAPI DllRegisterServer(void)
|
||||
{
|
||||
// registers object, typelib and all interfaces in typelib
|
||||
return _Module.RegisterServer(TRUE);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// DllUnregisterServer - Removes entries from the system registry
|
||||
|
||||
STDAPI DllUnregisterServer(void)
|
||||
{
|
||||
return _Module.UnregisterServer(TRUE);
|
||||
}
|
||||
|
||||
|
9
ase/com/asecom.def
Normal file
9
ase/com/asecom.def
Normal file
@ -0,0 +1,9 @@
|
||||
; ase.def : Declares the module parameters.
|
||||
|
||||
LIBRARY "asecom.dll"
|
||||
|
||||
EXPORTS
|
||||
DllCanUnloadNow @1 PRIVATE
|
||||
DllGetClassObject @2 PRIVATE
|
||||
DllRegisterServer @3 PRIVATE
|
||||
DllUnregisterServer @4 PRIVATE
|
207
ase/com/asecom.dsp
Normal file
207
ase/com/asecom.dsp
Normal file
@ -0,0 +1,207 @@
|
||||
# Microsoft Developer Studio Project File - Name="asecom" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=asecom - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "asecom.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "asecom.mak" CFG="asecom - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "asecom - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "asecom - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "asecom - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "../debug/lib"
|
||||
# PROP Intermediate_Dir "debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /Yu"stdafx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /ZI /Od /I "../.." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /FR /Yu"stdafx.h" /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo /o"debug/asecom.bsc"
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 aseawk.lib asecmn.lib aseutl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /implib:"debug/asecom.lib" /pdbtype:sept /libpath:"$(OutDir)"
|
||||
# Begin Custom Build - Performing registration
|
||||
IntDir=.\debug
|
||||
OutDir=.\../debug/lib
|
||||
TargetPath=\projects\ase\debug\lib\asecom.dll
|
||||
InputPath=\projects\ase\debug\lib\asecom.dll
|
||||
SOURCE="$(InputPath)"
|
||||
|
||||
"$(IntDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
copy .\asecom.tlb "$(OUTDIR)\asecom.tlb"
|
||||
if "%OS%"=="" goto NOTNT
|
||||
if not "%OS%"=="Windows_NT" goto NOTNT
|
||||
regsvr32 /s /c "$(TargetPath)"
|
||||
echo regsvr32 exec. time > "$(IntDir)\regsvr32.trg"
|
||||
goto end
|
||||
:NOTNT
|
||||
echo Warning : Cannot register DLL on Windows 95
|
||||
:end
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "asecom - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "../release/lib"
|
||||
# PROP Intermediate_Dir "release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /O1 /I "../.." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /D "_ATL_STATIC_REGISTRY" /Yu"stdafx.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo /o"release/awk.bsc"
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
|
||||
# ADD LINK32 aseawk.lib asecmn.lib aseutl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 /implib:"release/asecom.lib" /libpath:"$(OutDir)"
|
||||
# Begin Custom Build - Performing registration
|
||||
IntDir=.\release
|
||||
OutDir=.\../release/lib
|
||||
TargetPath=\projects\ase\release\lib\asecom.dll
|
||||
InputPath=\projects\ase\release\lib\asecom.dll
|
||||
SOURCE="$(InputPath)"
|
||||
|
||||
"$(IntDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
copy .\asecom.tlb "$(OUTDIR)\asecom.tlb"
|
||||
if "%OS%"=="" goto NOTNT
|
||||
if not "%OS%"=="Windows_NT" goto NOTNT
|
||||
regsvr32 /s /c "$(TargetPath)"
|
||||
echo regsvr32 exec. time > "$(IntDir)\regsvr32.trg"
|
||||
goto end
|
||||
:NOTNT
|
||||
echo Warning : Cannot register DLL on Windows 95
|
||||
:end
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "asecom - Win32 Debug"
|
||||
# Name "asecom - Win32 Release"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\asecom.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\asecom.def
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\asecom.idl
|
||||
# ADD MTL /tlb ".\asecom.tlb" /h "asecom.h" /iid "asecom_i.c" /Oicf
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\asecom.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Awk.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\AwkExtio.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Buffer.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\stdafx.cpp
|
||||
# ADD CPP /Yc"stdafx.h"
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Awk.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\awk_cp.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\AwkExtio.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Buffer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\resource.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\stdafx.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Awk.rgs
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\AwkExtio.rgs
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Buffer.rgs
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
318
ase/com/asecom.idl
Normal file
318
ase/com/asecom.idl
Normal file
@ -0,0 +1,318 @@
|
||||
/*
|
||||
* $Id: asecom.idl,v 1.3 2007/04/30 06:04:43 bacon Exp $
|
||||
*/
|
||||
|
||||
import "oaidl.idl";
|
||||
import "ocidl.idl";
|
||||
|
||||
/* IAwk */
|
||||
[
|
||||
object,
|
||||
uuid(05BC1C9F-7C4E-4F77-B186-2E0FD26C0641),
|
||||
dual,
|
||||
helpstring("ASE Awk Interface"),
|
||||
pointer_default(unique)
|
||||
]
|
||||
interface IAwk : IDispatch
|
||||
{
|
||||
[id(1), helpstring("method Parse")]
|
||||
HRESULT Parse([out,retval] VARIANT_BOOL* ret);
|
||||
|
||||
[id(2), helpstring("method Run")]
|
||||
HRESULT Run([in] VARIANT argarray, [out,retval] VARIANT_BOOL* ret);
|
||||
|
||||
[id(3), helpstring("method AddFunction")]
|
||||
HRESULT AddFunction([in] BSTR name, [in] int minArgs, [in] int maxArgs, [out,retval] VARIANT_BOOL* ret);
|
||||
|
||||
[id(4), helpstring("method DeleteFunction")]
|
||||
HRESULT DeleteFunction([in] BSTR name, [out,retval] VARIANT_BOOL* ret);
|
||||
|
||||
[propget, id(5), helpstring("property ErrorCode")]
|
||||
HRESULT ErrorCode([out,retval] int *pVal);
|
||||
|
||||
[propget, id(6), helpstring("property ErrorLine")]
|
||||
HRESULT ErrorLine([out,retval] int *pVal);
|
||||
|
||||
[propget, id(7), helpstring("property ErrorMessage")]
|
||||
HRESULT ErrorMessage([out,retval] BSTR *pVal);
|
||||
|
||||
[propget, id(8), helpstring("property ImplicitVariable")]
|
||||
HRESULT ImplicitVariable([out,retval] VARIANT_BOOL *pVal);
|
||||
[propput, id(8), helpstring("property ImplicitVariable")]
|
||||
HRESULT ImplicitVariable([in] VARIANT_BOOL newVal);
|
||||
|
||||
[propget, id(9), helpstring("property ExplicitVariable")]
|
||||
HRESULT ExplicitVariable([out,retval] VARIANT_BOOL *pVal);
|
||||
[propput, id(9), helpstring("property ExplicitVariable")]
|
||||
HRESULT ExplicitVariable([in] VARIANT_BOOL newVal);
|
||||
|
||||
[propget, id(10), helpstring("property UniqueFunction")]
|
||||
HRESULT UniqueFunction([out,retval] VARIANT_BOOL *pVal);
|
||||
[propput, id(10), helpstring("property UniqueFunction")]
|
||||
HRESULT UniqueFunction([in] VARIANT_BOOL newVal);
|
||||
|
||||
[propget, id(11), helpstring("property VariableShading")]
|
||||
HRESULT VariableShading([out,retval] VARIANT_BOOL *pVal);
|
||||
[propput, id(11), helpstring("property VariableShading")]
|
||||
HRESULT VariableShading([in] VARIANT_BOOL newVal);
|
||||
|
||||
[propget, id(12), helpstring("property ShiftOperators")]
|
||||
HRESULT ShiftOperators([out,retval] VARIANT_BOOL *pVal);
|
||||
[propput, id(12), helpstring("property ShiftOperators")]
|
||||
HRESULT ShiftOperators([in] VARIANT_BOOL newVal);
|
||||
|
||||
[propget, id(13), helpstring("property IdivOperator")]
|
||||
HRESULT IdivOperator([out,retval] VARIANT_BOOL *pVal);
|
||||
[propput, id(13), helpstring("property IdivOperator")]
|
||||
HRESULT IdivOperator([in] VARIANT_BOOL newVal);
|
||||
|
||||
[propget, id(14), helpstring("property ConcatString")]
|
||||
HRESULT ConcatString([out,retval] VARIANT_BOOL *pVal);
|
||||
[propput, id(14), helpstring("property ConcatString")]
|
||||
HRESULT ConcatString([in] VARIANT_BOOL newVal);
|
||||
|
||||
[propget, id(15), helpstring("property SupportExtio")]
|
||||
HRESULT SupportExtio([out,retval] VARIANT_BOOL *pVal);
|
||||
[propput, id(15), helpstring("property SupportExtio")]
|
||||
HRESULT SupportExtio([in] VARIANT_BOOL newVal);
|
||||
|
||||
[propget, id(16), helpstring("property SupportBlockless")]
|
||||
HRESULT SupportBlockless([out,retval] VARIANT_BOOL *pVal);
|
||||
[propput, id(16), helpstring("property SupportBlockless")]
|
||||
HRESULT SupportBlockless([in] VARIANT_BOOL newVal);
|
||||
|
||||
[propget, id(17), helpstring("property StringBaseOne")]
|
||||
HRESULT StringBaseOne([out,retval] VARIANT_BOOL *pVal);
|
||||
[propput, id(17), helpstring("property StringBaseOne")]
|
||||
HRESULT StringBaseOne([in] VARIANT_BOOL newVal);
|
||||
|
||||
[propget, id(18), helpstring("property StripSpaces")]
|
||||
HRESULT StripSpaces([out,retval] VARIANT_BOOL *pVal);
|
||||
[propput, id(18), helpstring("property StripSpaces")]
|
||||
HRESULT StripSpaces([in] VARIANT_BOOL newVal);
|
||||
|
||||
[propget, id(19), helpstring("property Nextofile")]
|
||||
HRESULT Nextofile([out,retval] VARIANT_BOOL *pVal);
|
||||
[propput, id(19), helpstring("property Nextofile")]
|
||||
HRESULT Nextofile([in] VARIANT_BOOL newVal);
|
||||
|
||||
[propget, id(20), helpstring("property UseCrlf")]
|
||||
HRESULT UseCrlf([out,retval] VARIANT_BOOL *pVal);
|
||||
[propput, id(20), helpstring("property UseCrlf")]
|
||||
HRESULT UseCrlf([in] VARIANT_BOOL newVal);
|
||||
|
||||
[propget, id(21), helpstring("property ArgumentsToEntryPoint")]
|
||||
HRESULT ArgumentsToEntryPoint([out,retval] VARIANT_BOOL *pVal);
|
||||
[propput, id(21), helpstring("property ArgumentsToEntryPoint")]
|
||||
HRESULT ArgumentsToEntryPoint([in] VARIANT_BOOL newVal);
|
||||
|
||||
[propget, id(22), helpstring("property MaxDepthForBlockParse")]
|
||||
HRESULT MaxDepthForBlockParse([out,retval] int *pVal);
|
||||
[propput, id(22), helpstring("property MaxDepthForBlockParse")]
|
||||
HRESULT MaxDepthForBlockParse([in] int newVal);
|
||||
|
||||
[propget, id(23), helpstring("property MaxDepthForBlockRun")]
|
||||
HRESULT MaxDepthForBlockRun([out,retval] int *pVal);
|
||||
[propput, id(23), helpstring("property MaxDepthForBlockRun")]
|
||||
HRESULT MaxDepthForBlockRun([in] int newVal);
|
||||
|
||||
[propget, id(24), helpstring("property MaxDepthForExprParse")]
|
||||
HRESULT MaxDepthForExprParse([out,retval] int *pVal);
|
||||
[propput, id(24), helpstring("property MaxDepthForExprParse")]
|
||||
HRESULT MaxDepthForExprParse([in] int newVal);
|
||||
|
||||
[propget, id(25), helpstring("property MaxDepthForExprRun")]
|
||||
HRESULT MaxDepthForExprRun([out,retval] int *pVal);
|
||||
[propput, id(25), helpstring("property MaxDepthForExprRun")]
|
||||
HRESULT MaxDepthForExprRun([in] int newVal);
|
||||
|
||||
[propget, id(26), helpstring("property MaxDepthForRexBuild")]
|
||||
HRESULT MaxDepthForRexBuild([out,retval] int *pVal);
|
||||
[propput, id(26), helpstring("property MaxDepthForRexBuild")]
|
||||
HRESULT MaxDepthForRexBuild([in] int newVal);
|
||||
|
||||
[propget, id(27), helpstring("property MaxDepthForRexMatch")]
|
||||
HRESULT MaxDepthForRexMatch([out,retval] int *pVal);
|
||||
[propput, id(27), helpstring("property MaxDepthForRexMatch")]
|
||||
HRESULT MaxDepthForRexMatch([in] int newVal);
|
||||
|
||||
[propget, id(28), helpstring("property EntryPoint")]
|
||||
HRESULT EntryPoint([out,retval] BSTR *pVal);
|
||||
[propput, id(28), helpstring("property EntryPoint")]
|
||||
HRESULT EntryPoint([in] BSTR newVal);
|
||||
|
||||
[propget, id(29), helpstring("property Debug")]
|
||||
HRESULT Debug([out,retval] VARIANT_BOOL *pVal);
|
||||
[propput, id(29), helpstring("property Debug")]
|
||||
HRESULT Debug([in] VARIANT_BOOL newVal);
|
||||
|
||||
[propget, id(30), helpstring("property UseLongLong")]
|
||||
HRESULT UseLongLong([out,retval] VARIANT_BOOL *pVal);
|
||||
[propput, id(30), helpstring("property UseLongLong")]
|
||||
HRESULT UseLongLong([in] VARIANT_BOOL newVal);
|
||||
};
|
||||
|
||||
/* ASECOM */
|
||||
[
|
||||
uuid(F9C69806-16A1-4162-998A-876B33C470BF),
|
||||
version(1.0),
|
||||
helpstring("ASECOM 1.0 Type Library")
|
||||
]
|
||||
library ASECOM
|
||||
{
|
||||
importlib("stdole32.tlb");
|
||||
importlib("stdole2.tlb");
|
||||
|
||||
[helpstring("Awk source mode")]
|
||||
typedef [v1_enum] enum AwkSourceMode
|
||||
{
|
||||
AWK_SOURCE_READ = 0,
|
||||
AWK_SOURCE_WRITE = 1
|
||||
} AwkSourceMode;
|
||||
|
||||
[helpstring("AwkExtio type")]
|
||||
typedef [v1_enum] enum AwkExtioType
|
||||
{
|
||||
AWK_EXTIO_PIPE = 0,
|
||||
AWK_EXTIO_COPROC = 1,
|
||||
AWK_EXTIO_FILE = 2,
|
||||
AWK_EXTIO_CONSOLE = 3
|
||||
} AwkExtioType;
|
||||
|
||||
[helpstring("AwkExtio mode")]
|
||||
typedef [v1_enum] enum AwkExtioMode
|
||||
{
|
||||
AWK_EXTIO_PIPE_READ = 0,
|
||||
AWK_EXTIO_PIPE_WRITE = 1,
|
||||
|
||||
AWK_EXTIO_COPROC_READ = 0,
|
||||
AWK_EXTIO_COPROC_WRITE = 1,
|
||||
AWK_EXTIO_COPROC_RDWR = 2,
|
||||
|
||||
AWK_EXTIO_FILE_READ = 0,
|
||||
AWK_EXTIO_FILE_WRITE = 1,
|
||||
AWK_EXTIO_FILE_APPEND = 2,
|
||||
|
||||
AWK_EXTIO_CONSOLE_READ = 0,
|
||||
AWK_EXTIO_CONSOLE_WRITE = 1
|
||||
} AwkExtioMode;
|
||||
|
||||
/* IBuffer */
|
||||
[
|
||||
object,
|
||||
uuid(AD5EA986-37E9-410E-A78E-21799104293A),
|
||||
dual,
|
||||
helpstring("IBuffer Interface"),
|
||||
pointer_default(unique)
|
||||
]
|
||||
interface IBuffer : IDispatch
|
||||
{
|
||||
[propget, id(1), helpstring("property Value")]
|
||||
HRESULT Value([out,retval] BSTR *pVal);
|
||||
|
||||
[propput, id(1), helpstring("property Value")]
|
||||
HRESULT Value([in] BSTR newVal);
|
||||
};
|
||||
|
||||
/* IAwkExtio */
|
||||
[
|
||||
object,
|
||||
uuid(BE0B91FF-9944-4DFC-A55B-1FE14E24AFEE),
|
||||
dual,
|
||||
helpstring("IAwkExtio Interface"),
|
||||
pointer_default(unique)
|
||||
]
|
||||
interface IAwkExtio : IDispatch
|
||||
{
|
||||
[propget, id(1), helpstring("property Name")]
|
||||
HRESULT Name([out,retval] BSTR *pVal);
|
||||
|
||||
[propget, id(2), helpstring("property Type")]
|
||||
HRESULT Type([out,retval] AwkExtioType *pVal);
|
||||
|
||||
[propget, id(3), helpstring("property Mode")]
|
||||
HRESULT Mode([out,retval] AwkExtioMode *pVal);
|
||||
|
||||
[propget, id(4), helpstring("property Handle")]
|
||||
HRESULT Handle([out,retval] VARIANT *pVal);
|
||||
[propput, id(4), helpstring("property Handle")]
|
||||
HRESULT Handle([in] VARIANT newVal);
|
||||
};
|
||||
|
||||
/* IAwkEvents */
|
||||
[
|
||||
uuid(1351DC8F-10AD-4C40-A2FA-9A2E89C27AC8),
|
||||
helpstring("ASE Awk Events Interface")
|
||||
]
|
||||
dispinterface IAwkEvents
|
||||
{
|
||||
properties:
|
||||
methods:
|
||||
[id(1), helpstring("open the source code")]
|
||||
HRESULT OpenSource([in] AwkSourceMode mode, [out,retval] int* ret);
|
||||
|
||||
[id(2), helpstring("close the source code")]
|
||||
HRESULT CloseSource([in] AwkSourceMode mode, [out,retval] int* ret);
|
||||
|
||||
[id(3), helpstring("read the source code")]
|
||||
HRESULT ReadSource([in] IBuffer* buf, [out,retval] int* ret);
|
||||
|
||||
[id(4), helpstring("write the source code")]
|
||||
HRESULT WriteSource([in] IBuffer* buf, [out,retval] int* ret);
|
||||
|
||||
[id(5), helpstring("method OpenExtio")]
|
||||
HRESULT OpenExtio([in] IAwkExtio* extio, [out,retval] int* ret);
|
||||
|
||||
[id(6), helpstring("method CloseExtio")]
|
||||
HRESULT CloseExtio([in] IAwkExtio* extio, [out,retval] int* ret);
|
||||
|
||||
[id(7), helpstring("method ReadExtio")]
|
||||
HRESULT ReadExtio([in] IAwkExtio* extio, [in] IBuffer* buf, [out,retval] int* ret);
|
||||
|
||||
[id(8), helpstring("method WriteExtio")]
|
||||
HRESULT WriteExtio([in] IAwkExtio* extio, [in] IBuffer* buf, [out,retval] int* ret);
|
||||
|
||||
[id(9), helpstring("method FlushExtio")]
|
||||
HRESULT FlushExtio([in] IAwkExtio* extio, [out,retval] int* ret);
|
||||
|
||||
[id(10), helpstring("method NextExtio")]
|
||||
HRESULT NextExtio([in] IAwkExtio* extio, [out,retval] int* ret);
|
||||
|
||||
[id(11), helpstring("method HandleFunction")]
|
||||
HRESULT HandleFunction([in] BSTR name, [in] VARIANT argarray, [out,retval] VARIANT* ret);
|
||||
|
||||
/*[id(12), helpstring("method OnClose")]
|
||||
HRESULT OnClose([out,retval] int* ret);*/
|
||||
};
|
||||
|
||||
/* Awk */
|
||||
[
|
||||
uuid(AD863B53-F5EC-45C3-8B1C-6AC678227DC8),
|
||||
helpstring("ASE Awk Class")
|
||||
]
|
||||
coclass Awk
|
||||
{
|
||||
[default] interface IAwk;
|
||||
[default,source] dispinterface IAwkEvents;
|
||||
};
|
||||
|
||||
/* AwkExtio */
|
||||
[
|
||||
uuid(F52F065A-5FD4-4F4D-AFEA-F5E446B16383),
|
||||
helpstring("ASE AwkExtio Class")
|
||||
]
|
||||
coclass AwkExtio
|
||||
{
|
||||
[default] interface IAwkExtio;
|
||||
};
|
||||
|
||||
/* Buffer */
|
||||
[
|
||||
uuid(866B79A7-7628-4808-8AE7-784BE2491C80),
|
||||
helpstring("ASE Buffer Class")
|
||||
]
|
||||
coclass Buffer
|
||||
{
|
||||
[default] interface IBuffer;
|
||||
};
|
||||
};
|
121
ase/com/asecom.rc
Normal file
121
ase/com/asecom.rc
Normal file
@ -0,0 +1,121 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "winres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""winres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"1 TYPELIB ""asecom.tlb""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,0
|
||||
PRODUCTVERSION 1,0,0,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "FileDescription", "ASE.COM"
|
||||
VALUE "FileVersion", "1, 0, 0, 0"
|
||||
VALUE "InternalName", "ASECOM"
|
||||
VALUE "LegalCopyright", "Hyung-Hwan Chung. All rights reserved"
|
||||
VALUE "OriginalFilename", "asecom.dll"
|
||||
VALUE "ProductName", "ASE.COM"
|
||||
VALUE "ProductVersion", "1, 0, 0, 0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// REGISTRY
|
||||
//
|
||||
|
||||
IDR_AWK REGISTRY "Awk.rgs"
|
||||
IDR_AWKEXTIO REGISTRY "AwkExtio.rgs"
|
||||
IDR_BUFFER REGISTRY "Buffer.rgs"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDS_PROJNAME "ASE COM Project"
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
1 TYPELIB "asecom.tlb"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
441
ase/com/asecom.vcproj
Normal file
441
ase/com/asecom.vcproj
Normal file
@ -0,0 +1,441 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="asecom"
|
||||
ProjectGUID="{963AF7B5-12E6-42B6-8CBE-89136C1A109B}"
|
||||
RootNamespace="asecom"
|
||||
Keyword="AtlProj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\..\debug\lib"
|
||||
IntermediateDirectory=".\debug"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Performing registration"
|
||||
CommandLine="copy .\asecom.tlb "$(OUTDIR)\asecom.tlb"
if "%OS%"=="" goto NOTNT
if not "%OS%"=="Windows_NT" goto NOTNT
regsvr32 /s /c "$(TargetPath)"
echo regsvr32 exec. time > "$(IntDir)\regsvr32.trg"
goto end
:NOTNT
echo Warning : Cannot register DLL on Windows 95
:end
"
|
||||
Outputs="$(IntDir)\regsvr32.trg"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\../debug/lib/asecom.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../.."
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="stdafx.h"
|
||||
PrecompiledHeaderFile=".\debug/asecom.pch"
|
||||
AssemblerListingLocation=".\debug/"
|
||||
ObjectFile=".\debug/"
|
||||
ProgramDataBaseFileName=".\debug/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="aseawk.lib asecmn.lib aseutl.lib odbc32.lib odbccp32.lib"
|
||||
OutputFile="$(OutDir)\asecom.dll"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories="$(OutDir)"
|
||||
ModuleDefinitionFile=".\asecom.def"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile=".\../debug/lib/asecom.pdb"
|
||||
SubSystem="2"
|
||||
ImportLibrary="debug/asecom.lib"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="debug/asecom.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\..\release\lib"
|
||||
IntermediateDirectory=".\release"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
UseOfATL="1"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Performing registration"
|
||||
CommandLine="copy .\asecom.tlb "$(OUTDIR)\asecom.tlb"
if "%OS%"=="" goto NOTNT
if not "%OS%"=="Windows_NT" goto NOTNT
regsvr32 /s /c "$(TargetPath)"
echo regsvr32 exec. time > "$(IntDir)\regsvr32.trg"
goto end
:NOTNT
echo Warning : Cannot register DLL on Windows 95
:end
"
|
||||
Outputs="$(IntDir)\regsvr32.trg"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\../release/lib/asecom.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="1"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="../.."
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="stdafx.h"
|
||||
PrecompiledHeaderFile=".\release/asecom.pch"
|
||||
AssemblerListingLocation=".\release/"
|
||||
ObjectFile=".\release/"
|
||||
ProgramDataBaseFileName=".\release/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="aseawk.lib asecmn.lib aseutl.lib odbc32.lib odbccp32.lib"
|
||||
OutputFile="$(OutDir)\asecom.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories="$(OutDir)"
|
||||
ModuleDefinitionFile=".\asecom.def"
|
||||
ProgramDatabaseFile=".\../release/lib/asecom.pdb"
|
||||
SubSystem="2"
|
||||
ImportLibrary="release/asecom.lib"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="release/awk.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="asecom.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="asecom.def"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="asecom.idl"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
GenerateStublessProxies="true"
|
||||
TypeLibraryName=".\asecom.tlb"
|
||||
HeaderFileName="asecom.h"
|
||||
InterfaceIdentifierFileName="asecom_i.c"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
GenerateStublessProxies="true"
|
||||
TypeLibraryName=".\asecom.tlb"
|
||||
HeaderFileName="asecom.h"
|
||||
InterfaceIdentifierFileName="asecom_i.c"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="asecom.rc"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
AdditionalIncludeDirectories="$(OUTDIR)"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
AdditionalIncludeDirectories="$(OUTDIR)"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="Awk.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="AwkExtio.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="Buffer.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="stdafx.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
<File
|
||||
RelativePath="Awk.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="awk_cp.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="AwkExtio.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="Buffer.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="resource.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="stdafx.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
>
|
||||
<File
|
||||
RelativePath="Awk.rgs"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="AwkExtio.rgs"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="Buffer.rgs"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
11
ase/com/aseps.def
Normal file
11
ase/com/aseps.def
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
LIBRARY "asePS"
|
||||
|
||||
DESCRIPTION 'Proxy/Stub DLL'
|
||||
|
||||
EXPORTS
|
||||
DllGetClassObject @1 PRIVATE
|
||||
DllCanUnloadNow @2 PRIVATE
|
||||
GetProxyDllInfo @3 PRIVATE
|
||||
DllRegisterServer @4 PRIVATE
|
||||
DllUnregisterServer @5 PRIVATE
|
16
ase/com/aseps.mk
Normal file
16
ase/com/aseps.mk
Normal file
@ -0,0 +1,16 @@
|
||||
|
||||
aseps.dll: dlldata.obj ase_p.obj ase_i.obj
|
||||
link /dll /out:aseps.dll /def:aseps.def /entry:DllMain dlldata.obj ase_p.obj ase_i.obj \
|
||||
kernel32.lib rpcndr.lib rpcns4.lib rpcrt4.lib oleaut32.lib uuid.lib \
|
||||
|
||||
.c.obj:
|
||||
cl /c /Ox /DWIN32 /D_WIN32_WINNT=0x0400 /DREGISTER_PROXY_DLL \
|
||||
$<
|
||||
|
||||
clean:
|
||||
@del aseps.dll
|
||||
@del aseps.lib
|
||||
@del aseps.exp
|
||||
@del dlldata.obj
|
||||
@del ase_p.obj
|
||||
@del ase_i.obj
|
637
ase/com/awk_cp.h
Normal file
637
ase/com/awk_cp.h
Normal file
@ -0,0 +1,637 @@
|
||||
/*
|
||||
* $Id: awk_cp.h,v 1.3 2007/04/30 06:04:43 bacon Exp $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#ifndef _AWK_CP_H_
|
||||
#define _AWK_CP_H_
|
||||
|
||||
template <class T>
|
||||
class CProxyIAwkEvents:
|
||||
public IConnectionPointImpl<T, &DIID_IAwkEvents, CComDynamicUnkArray>
|
||||
{
|
||||
public:
|
||||
INT Fire_OpenSource(INT mode)
|
||||
{
|
||||
T* pT = static_cast<T*>(this);
|
||||
int i, nconns = m_vec.GetSize();
|
||||
CComVariant args[1], ret;
|
||||
|
||||
for (i = 0; i < nconns; i++)
|
||||
{
|
||||
pT->Lock();
|
||||
CComPtr<IUnknown> sp = m_vec.GetAt(i);
|
||||
pT->Unlock();
|
||||
|
||||
IDispatch* pDispatch =
|
||||
reinterpret_cast<IDispatch*>(sp.p);
|
||||
if (pDispatch == NULL) continue;
|
||||
|
||||
VariantClear (&ret);
|
||||
VariantClear (&args[0]);
|
||||
|
||||
args[0] = mode;
|
||||
|
||||
DISPPARAMS disp = { args, NULL, 1, 0 };
|
||||
HRESULT hr = pDispatch->Invoke (
|
||||
0x1, IID_NULL, LOCALE_USER_DEFAULT,
|
||||
DISPATCH_METHOD, &disp, &ret, NULL, NULL);
|
||||
if (FAILED(hr)) continue;
|
||||
|
||||
if (ret.vt == VT_EMPTY)
|
||||
{
|
||||
/* probably, the handler has not been implemeted*/
|
||||
continue;
|
||||
}
|
||||
|
||||
hr = ret.ChangeType (VT_I4);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
/* TODO: set the error code properly... */
|
||||
/* invalid value returned... */
|
||||
return -1;
|
||||
}
|
||||
|
||||
return ret.lVal;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
INT Fire_CloseSource(INT mode)
|
||||
{
|
||||
T* pT = static_cast<T*>(this);
|
||||
int i, nconns = m_vec.GetSize();
|
||||
CComVariant args[1], ret;
|
||||
|
||||
for (i = 0; i < nconns; i++)
|
||||
{
|
||||
pT->Lock();
|
||||
CComPtr<IUnknown> sp = m_vec.GetAt(i);
|
||||
pT->Unlock();
|
||||
|
||||
IDispatch* pDispatch =
|
||||
reinterpret_cast<IDispatch*>(sp.p);
|
||||
if (pDispatch == NULL) continue;
|
||||
|
||||
VariantClear (&ret);
|
||||
VariantClear (&args[0]);
|
||||
|
||||
args[0] = mode;
|
||||
|
||||
DISPPARAMS disp = { args, NULL, 1, 0 };
|
||||
HRESULT hr = pDispatch->Invoke (
|
||||
0x2, IID_NULL, LOCALE_USER_DEFAULT,
|
||||
DISPATCH_METHOD, &disp, &ret, NULL, NULL);
|
||||
if (FAILED(hr)) continue;
|
||||
|
||||
if (ret.vt == VT_EMPTY)
|
||||
{
|
||||
/* probably, the handler has not been implemeted*/
|
||||
continue;
|
||||
}
|
||||
|
||||
hr = ret.ChangeType (VT_I4);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
/* TODO: set the error code properly... */
|
||||
/* invalid value returned... */
|
||||
return -1;
|
||||
}
|
||||
|
||||
return ret.lVal;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
INT Fire_ReadSource (IBuffer* buf)
|
||||
{
|
||||
T* pT = static_cast<T*>(this);
|
||||
int i, nconns = m_vec.GetSize();
|
||||
CComVariant args[1], ret;
|
||||
|
||||
for (i = 0; i < nconns; i++)
|
||||
{
|
||||
pT->Lock();
|
||||
CComPtr<IUnknown> sp = m_vec.GetAt(i);
|
||||
pT->Unlock();
|
||||
|
||||
IDispatch* pDispatch =
|
||||
reinterpret_cast<IDispatch*>(sp.p);
|
||||
if (pDispatch == NULL) continue;
|
||||
|
||||
VariantClear (&ret);
|
||||
VariantClear (&args[0]);
|
||||
|
||||
args[0] = (IUnknown*)buf;
|
||||
|
||||
DISPPARAMS disp = { args, NULL, 1, 0 };
|
||||
HRESULT hr = pDispatch->Invoke (
|
||||
0x3, IID_NULL, LOCALE_USER_DEFAULT,
|
||||
DISPATCH_METHOD, &disp, &ret, NULL, NULL);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ret.vt == VT_EMPTY)
|
||||
{
|
||||
/* probably, the handler has not been implemeted*/
|
||||
continue;
|
||||
}
|
||||
|
||||
hr = ret.ChangeType (VT_I4);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
/* TODO: set the error code properly... */
|
||||
/* invalid value returned... */
|
||||
return -1;
|
||||
}
|
||||
|
||||
return ret.lVal;
|
||||
}
|
||||
|
||||
/* no event handler attached for the source code read. */
|
||||
/* TODO: set error code ... */
|
||||
return -1;
|
||||
}
|
||||
|
||||
INT Fire_WriteSource (IBuffer* buf)
|
||||
{
|
||||
T* pT = static_cast<T*>(this);
|
||||
int i, nconns = m_vec.GetSize();
|
||||
CComVariant args[1], ret;
|
||||
|
||||
for (i = 0; i < nconns; i++)
|
||||
{
|
||||
pT->Lock();
|
||||
CComPtr<IUnknown> sp = m_vec.GetAt(i);
|
||||
pT->Unlock();
|
||||
|
||||
IDispatch* pDispatch =
|
||||
reinterpret_cast<IDispatch*>(sp.p);
|
||||
if (pDispatch == NULL) continue;
|
||||
|
||||
VariantClear (&ret);
|
||||
VariantClear (&args[0]);
|
||||
|
||||
args[0] = (IUnknown*)buf;
|
||||
|
||||
DISPPARAMS disp = { args, NULL, 1, 0 };
|
||||
HRESULT hr = pDispatch->Invoke (
|
||||
0x4, IID_NULL, LOCALE_USER_DEFAULT,
|
||||
DISPATCH_METHOD, &disp, &ret, NULL, NULL);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ret.vt == VT_EMPTY)
|
||||
{
|
||||
/* probably, the handler has not been implemeted*/
|
||||
continue;
|
||||
}
|
||||
|
||||
hr = ret.ChangeType (VT_I4);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
/* TODO: set the error code properly... */
|
||||
/* invalid value returned... */
|
||||
return -1;
|
||||
}
|
||||
|
||||
return ret.lVal;
|
||||
}
|
||||
|
||||
/* no event handler attached for the source code write.
|
||||
* make the operation succeed by returning the reqested
|
||||
* data length. */
|
||||
CComBSTR bstr;
|
||||
buf->get_Value (&bstr);
|
||||
return bstr.Length();
|
||||
}
|
||||
|
||||
INT Fire_OpenExtio (IAwkExtio* extio)
|
||||
{
|
||||
T* pT = static_cast<T*>(this);
|
||||
int i, nconns = m_vec.GetSize();
|
||||
CComVariant args[1], ret;
|
||||
|
||||
for (i = 0; i < nconns; i++)
|
||||
{
|
||||
pT->Lock();
|
||||
CComPtr<IUnknown> sp = m_vec.GetAt(i);
|
||||
pT->Unlock();
|
||||
|
||||
IDispatch* pDispatch =
|
||||
reinterpret_cast<IDispatch*>(sp.p);
|
||||
if (pDispatch == NULL) continue;
|
||||
|
||||
VariantClear (&ret);
|
||||
VariantClear (&args[0]);
|
||||
|
||||
args[0] = (IUnknown*)extio;
|
||||
|
||||
DISPPARAMS disp = { args, NULL, 1, 0 };
|
||||
HRESULT hr = pDispatch->Invoke (
|
||||
0x5, IID_NULL, LOCALE_USER_DEFAULT,
|
||||
DISPATCH_METHOD, &disp, &ret, NULL, NULL);
|
||||
if (FAILED(hr)) continue;
|
||||
|
||||
if (ret.vt == VT_EMPTY)
|
||||
{
|
||||
/* probably, the handler has not been implemeted*/
|
||||
continue;
|
||||
}
|
||||
|
||||
hr = ret.ChangeType (VT_I4);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
/* TODO: set the error code properly... */
|
||||
/* invalid value returned... */
|
||||
return -1;
|
||||
}
|
||||
|
||||
return ret.lVal;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
INT Fire_CloseExtio (IAwkExtio* extio)
|
||||
{
|
||||
T* pT = static_cast<T*>(this);
|
||||
int i, nconns = m_vec.GetSize();
|
||||
CComVariant args[1], ret;
|
||||
|
||||
for (i = 0; i < nconns; i++)
|
||||
{
|
||||
pT->Lock();
|
||||
CComPtr<IUnknown> sp = m_vec.GetAt(i);
|
||||
pT->Unlock();
|
||||
|
||||
IDispatch* pDispatch =
|
||||
reinterpret_cast<IDispatch*>(sp.p);
|
||||
if (pDispatch == NULL) continue;
|
||||
|
||||
VariantClear (&ret);
|
||||
VariantClear (&args[0]);
|
||||
|
||||
args[0] = (IUnknown*)extio;
|
||||
|
||||
DISPPARAMS disp = { args, NULL, 1, 0 };
|
||||
HRESULT hr = pDispatch->Invoke (
|
||||
0x6, IID_NULL, LOCALE_USER_DEFAULT,
|
||||
DISPATCH_METHOD, &disp, &ret, NULL, NULL);
|
||||
if (FAILED(hr)) continue;
|
||||
|
||||
if (ret.vt == VT_EMPTY)
|
||||
{
|
||||
/* probably, the handler has not been implemeted*/
|
||||
continue;
|
||||
}
|
||||
|
||||
hr = ret.ChangeType (VT_I4);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
/* TODO: set the error code properly... */
|
||||
/* invalid value returned... */
|
||||
return -1;
|
||||
}
|
||||
|
||||
return ret.lVal;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
INT Fire_ReadExtio (IAwkExtio* extio, IBuffer* buf)
|
||||
{
|
||||
T* pT = static_cast<T*>(this);
|
||||
int i, nconns = m_vec.GetSize();
|
||||
CComVariant args[2], ret;
|
||||
|
||||
for (i = 0; i < nconns; i++)
|
||||
{
|
||||
pT->Lock();
|
||||
CComPtr<IUnknown> sp = m_vec.GetAt(i);
|
||||
pT->Unlock();
|
||||
|
||||
IDispatch* pDispatch =
|
||||
reinterpret_cast<IDispatch*>(sp.p);
|
||||
if (pDispatch == NULL) continue;
|
||||
|
||||
VariantClear (&ret);
|
||||
VariantClear (&args[0]);
|
||||
VariantClear (&args[1]);
|
||||
|
||||
args[1] = (IUnknown*)extio;
|
||||
args[0] = (IUnknown*)buf;
|
||||
|
||||
DISPPARAMS disp = { args, NULL, 2, 0 };
|
||||
HRESULT hr = pDispatch->Invoke (
|
||||
0x7, IID_NULL, LOCALE_USER_DEFAULT,
|
||||
DISPATCH_METHOD, &disp, &ret, NULL, NULL);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ret.vt == VT_EMPTY)
|
||||
{
|
||||
/* probably, the handler has not been implemeted*/
|
||||
continue;
|
||||
}
|
||||
|
||||
hr = ret.ChangeType (VT_I4);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
/* TODO: set the error code properly... */
|
||||
/* invalid value returned... */
|
||||
return -1;
|
||||
}
|
||||
|
||||
return ret.lVal;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
INT Fire_WriteExtio (IAwkExtio* extio, IBuffer* buf)
|
||||
{
|
||||
T* pT = static_cast<T*>(this);
|
||||
int i, nconns = m_vec.GetSize();
|
||||
CComVariant args[2], ret;
|
||||
|
||||
for (i = 0; i < nconns; i++)
|
||||
{
|
||||
pT->Lock();
|
||||
CComPtr<IUnknown> sp = m_vec.GetAt(i);
|
||||
pT->Unlock();
|
||||
|
||||
IDispatch* pDispatch =
|
||||
reinterpret_cast<IDispatch*>(sp.p);
|
||||
if (pDispatch == NULL) continue;
|
||||
|
||||
VariantClear (&ret);
|
||||
VariantClear (&args[0]);
|
||||
VariantClear (&args[1]);
|
||||
|
||||
args[1] = (IUnknown*)extio;
|
||||
args[0] = (IUnknown*)buf;
|
||||
|
||||
DISPPARAMS disp = { args, NULL, 2, 0 };
|
||||
HRESULT hr = pDispatch->Invoke (
|
||||
0x8, IID_NULL, LOCALE_USER_DEFAULT,
|
||||
DISPATCH_METHOD, &disp, &ret, NULL, NULL);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ret.vt == VT_EMPTY)
|
||||
{
|
||||
/* probably, the handler has not been implemeted*/
|
||||
continue;
|
||||
}
|
||||
|
||||
hr = ret.ChangeType (VT_I4);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
/* TODO: set the error code properly... */
|
||||
/* invalid value returned... */
|
||||
return -1;
|
||||
}
|
||||
|
||||
return ret.lVal;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
INT Fire_FlushExtio (IAwkExtio* extio)
|
||||
{
|
||||
T* pT = static_cast<T*>(this);
|
||||
int i, nconns = m_vec.GetSize();
|
||||
CComVariant args[1], ret;
|
||||
|
||||
for (i = 0; i < nconns; i++)
|
||||
{
|
||||
pT->Lock();
|
||||
CComPtr<IUnknown> sp = m_vec.GetAt(i);
|
||||
pT->Unlock();
|
||||
|
||||
IDispatch* pDispatch =
|
||||
reinterpret_cast<IDispatch*>(sp.p);
|
||||
if (pDispatch == NULL) continue;
|
||||
|
||||
VariantClear (&ret);
|
||||
VariantClear (&args[0]);
|
||||
|
||||
args[0] = (IUnknown*)extio;
|
||||
|
||||
DISPPARAMS disp = { args, NULL, 1, 0 };
|
||||
HRESULT hr = pDispatch->Invoke (
|
||||
0x9, IID_NULL, LOCALE_USER_DEFAULT,
|
||||
DISPATCH_METHOD, &disp, &ret, NULL, NULL);
|
||||
if (FAILED(hr)) continue;
|
||||
|
||||
if (ret.vt == VT_EMPTY)
|
||||
{
|
||||
/* probably, the handler has not been implemeted*/
|
||||
continue;
|
||||
}
|
||||
|
||||
hr = ret.ChangeType (VT_I4);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
/* TODO: set the error code properly... */
|
||||
/* invalid value returned... */
|
||||
return -1;
|
||||
}
|
||||
|
||||
return ret.lVal;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
INT Fire_NextExtio (IAwkExtio* extio)
|
||||
{
|
||||
T* pT = static_cast<T*>(this);
|
||||
int i, nconns = m_vec.GetSize();
|
||||
CComVariant args[1], ret;
|
||||
|
||||
for (i = 0; i < nconns; i++)
|
||||
{
|
||||
pT->Lock();
|
||||
CComPtr<IUnknown> sp = m_vec.GetAt(i);
|
||||
pT->Unlock();
|
||||
|
||||
IDispatch* pDispatch =
|
||||
reinterpret_cast<IDispatch*>(sp.p);
|
||||
if (pDispatch == NULL) continue;
|
||||
|
||||
VariantClear (&ret);
|
||||
VariantClear (&args[0]);
|
||||
|
||||
args[0] = (IUnknown*)extio;
|
||||
|
||||
DISPPARAMS disp = { args, NULL, 1, 0 };
|
||||
HRESULT hr = pDispatch->Invoke (
|
||||
0xA, IID_NULL, LOCALE_USER_DEFAULT,
|
||||
DISPATCH_METHOD, &disp, &ret, NULL, NULL);
|
||||
if (FAILED(hr)) continue;
|
||||
|
||||
if (ret.vt == VT_EMPTY)
|
||||
{
|
||||
/* probably, the handler has not been implemeted*/
|
||||
continue;
|
||||
}
|
||||
|
||||
hr = ret.ChangeType (VT_I4);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
/* TODO: set the error code properly... */
|
||||
/* invalid value returned... */
|
||||
return -1;
|
||||
}
|
||||
|
||||
return ret.lVal;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int Fire_HandleFunction (
|
||||
ase_awk_run_t* run, BSTR name, SAFEARRAY* argarray, ase_awk_val_t** retv)
|
||||
{
|
||||
T* pT = static_cast<T*>(this);
|
||||
int i, nconns = m_vec.GetSize();
|
||||
CComVariant ret;
|
||||
VARIANT args[2];
|
||||
ase_awk_val_t* v;
|
||||
|
||||
VariantInit (&args[0]);
|
||||
VariantInit (&args[1]);
|
||||
|
||||
args[1].vt = VT_BSTR;
|
||||
args[1].bstrVal = name;
|
||||
|
||||
args[0].vt = VT_ARRAY | VT_VARIANT;
|
||||
args[0].parray = argarray;
|
||||
|
||||
for (i = 0; i < nconns; i++)
|
||||
{
|
||||
pT->Lock();
|
||||
CComPtr<IUnknown> sp = m_vec.GetAt(i);
|
||||
pT->Unlock();
|
||||
|
||||
IDispatch* pDispatch =
|
||||
reinterpret_cast<IDispatch*>(sp.p);
|
||||
if (pDispatch == NULL) continue;
|
||||
|
||||
VariantClear (&ret);
|
||||
|
||||
DISPPARAMS disp = { args, NULL, 2, 0 };
|
||||
HRESULT hr = pDispatch->Invoke (
|
||||
0xB, IID_NULL, LOCALE_USER_DEFAULT,
|
||||
DISPATCH_METHOD, &disp, &ret, NULL, NULL);
|
||||
if (FAILED(hr)) continue;
|
||||
|
||||
if (ret.vt == VT_EMPTY)
|
||||
{
|
||||
/* probably, the handler has not been implemeted*/
|
||||
continue;
|
||||
}
|
||||
|
||||
VariantClear (&args[1]);
|
||||
VariantClear (&args[0]);
|
||||
|
||||
if (ret.vt == VT_I1)
|
||||
v = ase_awk_makeintval (run, ret.cVal);
|
||||
else if (ret.vt == VT_I2)
|
||||
v = ase_awk_makeintval (run, ret.iVal);
|
||||
else if (ret.vt == VT_I4)
|
||||
v = ase_awk_makeintval (run, ret.lVal);
|
||||
else if (ret.vt == VT_I8)
|
||||
v = ase_awk_makeintval (run, ret.llVal);
|
||||
else if (ret.vt == VT_UI1)
|
||||
v = ase_awk_makeintval (run, ret.bVal);
|
||||
else if (ret.vt == VT_UI2)
|
||||
v = ase_awk_makeintval (run, ret.uiVal);
|
||||
else if (ret.vt == VT_UI4)
|
||||
v = ase_awk_makeintval (run, ret.ulVal);
|
||||
else if (ret.vt == VT_UI8)
|
||||
v = ase_awk_makeintval (run, ret.ullVal);
|
||||
else if (ret.vt == VT_INT)
|
||||
v = ase_awk_makeintval (run, ret.intVal);
|
||||
else if (ret.vt == VT_UINT)
|
||||
v = ase_awk_makeintval (run, ret.uintVal);
|
||||
else if (ret.vt == VT_BOOL)
|
||||
v = ase_awk_makeintval (run, ((ret.boolVal == 0)? 0: 1));
|
||||
else if (ret.vt == VT_R4)
|
||||
v = ase_awk_makerealval (run, ret.fltVal);
|
||||
else if (ret.vt == VT_R8)
|
||||
v = ase_awk_makerealval (run, ret.dblVal);
|
||||
else if (ret.vt == VT_BSTR)
|
||||
v = ase_awk_makestrval (run, ret.bstrVal, SysStringLen(ret.bstrVal));
|
||||
else if (ret.vt == VT_NULL)
|
||||
|
||||
v = ase_awk_val_nil;
|
||||
else return 3; /* wrong return value */
|
||||
|
||||
if (v == ASE_NULL) return 1; /* out of memory */
|
||||
|
||||
*retv = v;
|
||||
return 0; /* success */
|
||||
}
|
||||
|
||||
VariantClear (&args[1]);
|
||||
VariantClear (&args[0]);
|
||||
return 2; /* no proper handler */
|
||||
}
|
||||
|
||||
INT Fire_OnClose ()
|
||||
{
|
||||
T* pT = static_cast<T*>(this);
|
||||
int i, nconns = m_vec.GetSize();
|
||||
CComVariant ret;
|
||||
|
||||
for (i = 0; i < nconns; i++)
|
||||
{
|
||||
pT->Lock();
|
||||
CComPtr<IUnknown> sp = m_vec.GetAt(i);
|
||||
pT->Unlock();
|
||||
|
||||
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
|
||||
if (pDispatch == NULL) continue;
|
||||
|
||||
VariantClear (&ret);
|
||||
|
||||
HRESULT hr = pDispatch->Invoke(
|
||||
0xC, IID_NULL, LOCALE_USER_DEFAULT,
|
||||
DISPATCH_METHOD, NULL, &ret, NULL, NULL);
|
||||
|
||||
if (FAILED(hr)) continue;
|
||||
if (ret.vt == VT_EMPTY) continue;
|
||||
|
||||
hr = ret.ChangeType (VT_I4);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
/* TODO: set the error code properly... */
|
||||
/* invalid value returned... */
|
||||
return -1;
|
||||
}
|
||||
|
||||
return ret.lVal;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
19
ase/com/resource.h
Normal file
19
ase/com/resource.h
Normal file
@ -0,0 +1,19 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by asecom.rc
|
||||
//
|
||||
#define IDS_PROJNAME 100
|
||||
#define IDR_AWK 101
|
||||
#define IDR_AWKEXTIO 102
|
||||
#define IDR_BUFFER 103
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 201
|
||||
#define _APS_NEXT_COMMAND_VALUE 32768
|
||||
#define _APS_NEXT_CONTROL_VALUE 201
|
||||
#define _APS_NEXT_SYMED_VALUE 105
|
||||
#endif
|
||||
#endif
|
18
ase/com/stdafx.cpp
Normal file
18
ase/com/stdafx.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* $Id: stdafx.cpp,v 1.3 2007/04/30 06:04:43 bacon Exp $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// stdafx.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#ifdef _ATL_STATIC_REGISTRY
|
||||
#include <statreg.h>
|
||||
#include <statreg.cpp>
|
||||
#endif
|
||||
|
||||
#include <atlimpl.cpp>
|
29
ase/com/stdafx.h
Normal file
29
ase/com/stdafx.h
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* $Id: stdafx.h,v 1.3 2007/04/30 06:04:43 bacon Exp $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#ifndef _ASE_COM_STDAFX_H_
|
||||
#define _ASE_COM_STDAFX_H_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#define STRICT
|
||||
#ifndef _WIN32_WINNT
|
||||
#define _WIN32_WINNT 0x0400
|
||||
#endif
|
||||
#define _ATL_APARTMENT_THREADED
|
||||
|
||||
#include <atlbase.h>
|
||||
//You may derive a class from CComModule and use it if you want to override
|
||||
//something, but do not change the name of _Module
|
||||
extern CComModule _Module;
|
||||
#include <atlcom.h>
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user