// RcRcHelloWorldCmd.cpp : Implementation of CRcRcHelloWorldCmd

#include "stdafx.h"
#include "RcHelloWorldCmd.h"
#include "RpExamplesPlugin.h"


// CRcHelloWorldCmd

STDMETHODIMP CRcHelloWorldCmd::OnGetValue(CONID conID, IRsDataCache* pDataCache, VARIANT* pVtData, RtBool* pHandled)
{
	return S_OK;
}

STDMETHODIMP CRcHelloWorldCmd::OnSetValue(CONID con_id, IRsDataCache* pDataCache, VARIANT* pvtData, RtBool* pHandled)
{
	return S_OK;
}
STDMETHODIMP CRcHelloWorldCmd::OnDefaultValue(CONID con_id, VARIANT* pVtData, RtBool* pHandled)
{
	return S_OK;
}

STDMETHODIMP CRcHelloWorldCmd::OnInvalidate(CONID con_id, RtBool* pHandled)
{
	return S_OK;
}

STDMETHODIMP CRcHelloWorldCmd::OnInitialize(void)
{
	return S_OK;
}

STDMETHODIMP CRcHelloWorldCmd::OnLoadDefault(void)
{
	return S_OK;
}

STDMETHODIMP CRcHelloWorldCmd::OnDestroy(void)
{
	return S_OK;
}

HRESULT CRcHelloWorldCmd::FinalConstruct()
{
	// kernel package
	CComPtr<IRpKernel> spKernelPck;
	HRESULT hRes = CRpExamplesPlugin::GetKernelPackage(&spKernelPck);
	
	// create base node
	if (SUCCEEDED(hRes))
		hRes = spKernelPck->CreateBaseNode(GetControllingUnknown(), &m_spUnkAgg);

	return hRes;
}

STDMETHODIMP CRcHelloWorldCmd::Execute(void)
{
	MessageBox(NULL,L"Hello world",L"Message", MB_OK);
	return S_OK;
}

STDMETHODIMP CRcHelloWorldCmd::Undo(void)
{
	return S_OK;
}

STDMETHODIMP CRcHelloWorldCmd::Redo(void)
{
	return S_OK;
}

STDMETHODIMP CRcHelloWorldCmd::HasUndo(RtBool* isUndoable)
{
	//Command is not undoable.
	*isUndoable = false;
	return S_OK;
}


