qse/ase/com/AwkExtio.cpp

69 lines
1.2 KiB
C++
Raw Normal View History

2006-12-09 11:50:08 +00:00
/*
2007-01-10 14:30:44 +00:00
* $Id: AwkExtio.cpp,v 1.8 2007-01-10 14:30:44 bacon Exp $
2006-12-09 11:50:08 +00:00
*/
#include "stdafx.h"
#include "ase.h"
#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;
}
2006-12-09 11:50:08 +00:00
STDMETHODIMP CAwkExtio::get_Type(int *pVal)
{
*pVal = type;
return S_OK;
}
STDMETHODIMP CAwkExtio::get_Mode(int *pVal)
{
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;
}