qse/ase/com/AwkExtio.cpp

71 lines
1.2 KiB
C++
Raw Normal View History

2006-12-09 11:50:08 +00:00
/*
2007-04-15 13:15:35 +00:00
* $Id: AwkExtio.cpp,v 1.11 2007-04-15 13:15:35 bacon Exp $
2007-02-03 10:52:36 +00:00
*
* {License}
2006-12-09 11:50:08 +00:00
*/
#include "stdafx.h"
2007-03-24 05:18:32 +00:00
#include "asecom.h"
2006-12-09 11:50:08 +00:00
#include "AwkExtio.h"
2006-12-09 17:36:27 +00:00
#include <stdio.h>
2006-12-09 11:50:08 +00:00
/////////////////////////////////////////////////////////////////////////////
// CAwkExtio
2006-12-15 06:47:09 +00:00
CAwkExtio::CAwkExtio (): name (NULL)
2006-12-09 11:50:08 +00:00
{
2006-12-15 06:47:09 +00:00
VariantInit (&handle);
2006-12-09 11:50:08 +00:00
}
CAwkExtio::~CAwkExtio ()
{
2006-12-10 16:13:50 +00:00
if (name != NULL) SysFreeString (name);
2006-12-15 06:47:09 +00:00
VariantClear (&handle);
2006-12-09 11:50:08 +00:00
}
2006-12-10 16:13:50 +00:00
STDMETHODIMP CAwkExtio::get_Name (BSTR *pVal)
2006-12-09 11:50:08 +00:00
{
2006-12-10 16:13:50 +00:00
if (name == NULL) *pVal = name;
else
{
BSTR tmp = SysAllocStringLen (name, SysStringLen(name));
2006-12-15 06:47:09 +00:00
if (tmp == NULL) return E_OUTOFMEMORY;
2006-12-10 16:13:50 +00:00
*pVal = tmp;
}
2006-12-09 11:50:08 +00:00
return S_OK;
}
2006-12-10 16:13:50 +00:00
BOOL CAwkExtio::PutName (const TCHAR* val)
{
if (name != NULL) SysFreeString (name);
name = SysAllocString (val);
return (name == NULL)? FALSE: TRUE;
}
2007-04-15 13:15:35 +00:00
STDMETHODIMP CAwkExtio::get_Type(AwkExtioType *pVal)
2006-12-09 11:50:08 +00:00
{
*pVal = type;
return S_OK;
}
2007-04-15 13:15:35 +00:00
STDMETHODIMP CAwkExtio::get_Mode(AwkExtioMode *pVal)
2006-12-09 11:50:08 +00:00
{
2006-12-10 16:13:50 +00:00
*pVal = mode;
2006-12-09 11:50:08 +00:00
return S_OK;
}
2006-12-11 14:58:25 +00:00
STDMETHODIMP CAwkExtio::get_Handle (VARIANT *pVal)
{
2006-12-15 06:47:09 +00:00
VariantClear (pVal);
2006-12-12 05:54:33 +00:00
VariantCopy (pVal, &handle);
2006-12-11 14:58:25 +00:00
return S_OK;
}
STDMETHODIMP CAwkExtio::put_Handle (VARIANT newVal)
{
2006-12-15 06:47:09 +00:00
VariantClear (&handle);
VariantCopy (&handle, &newVal);
2006-12-11 14:58:25 +00:00
return S_OK;
}