qse/ase/com/AwkExtio.cpp

75 lines
1.3 KiB
C++
Raw Normal View History

2006-12-09 11:50:08 +00:00
/*
2006-12-11 14:58:25 +00:00
* $Id: AwkExtio.cpp,v 1.4 2006-12-11 14:58:25 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-10 16:13:50 +00:00
CAwkExtio::CAwkExtio (): name (NULL)
2006-12-09 11:50:08 +00:00
{
2006-12-09 17:36:27 +00:00
#ifdef _DEBUG
TCHAR x[128];
_sntprintf (x, 128, _T("CAwkExtio::CAwkExtio %p"), this);
MessageBox (NULL, x, x, MB_OK);
#endif
2006-12-09 11:50:08 +00:00
}
CAwkExtio::~CAwkExtio ()
{
2006-12-09 17:36:27 +00:00
#ifdef _DEBUG
TCHAR x[128];
_sntprintf (x, 128, _T("CAwkExtio::~CAwkExtio %p"), this);
MessageBox (NULL, x, x, MB_OK);
#endif
2006-12-10 16:13:50 +00:00
if (name != NULL) SysFreeString (name);
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));
if (tmp = NULL) return E_OUTOFMEMORY;
*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)
{
*pVal = handle;
return S_OK;
}
STDMETHODIMP CAwkExtio::put_Handle (VARIANT newVal)
{
handle.Copy (&newVal);
return S_OK;
}