|
// PSLEnvironmentVar.cpp : Implementation of CPSLEnvironmentVar
#include "stdafx.h"
#include "PSLEnvironmentVar.h"
CPSLEnvironmentVar::CPSLEnvironmentVar()
{
m_sName = _T("");
m_sValue = _T("");
}
HRESULT CPSLEnvironmentVar::FinalConstruct()
{
return S_OK;
}
void CPSLEnvironmentVar::FinalRelease()
{
}
void CPSLEnvironmentVar::Initialize(LPCTSTR sName, LPCTSTR sValue)
{
m_sName = sName;
m_sValue = sValue;
}
////////////////////////////////////////////////////////////////////////
// Interface Implementation;
////////////////////////////////////////////////////////////////////////
STDMETHODIMP CPSLEnvironmentVar::get_Name(BSTR * pValue)
{
PSL_BEGIN
*pValue = m_sName.copy();
PSL_END
}
STDMETHODIMP CPSLEnvironmentVar::get_Value(BSTR * pValue)
{
PSL_BEGIN
*pValue = m_sValue.copy();
PSL_END
}
STDMETHODIMP CPSLEnvironmentVar::put_Value(BSTR newValue)
{
PSL_BEGIN
if(::SetEnvironmentVariable(m_sName, _bstr_t(newValue)))
m_sValue = newValue;
PSL_END
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.