// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A // PARTICULAR PURPOSE. // // Copyright (c) Microsoft Corporation. All rights reserved. #include "StdAfx.h" #include "HelloWorldContent.h" CHelloWorldContent::CHelloWorldContent() : m_nRef(0) { AddRef(); } CHelloWorldContent::~CHelloWorldContent() { } // // IUnknown methods // HRESULT CHelloWorldContent::QueryInterface( REFIID riid, LPVOID* ppvObject ) { if (IID_IUnknown == riid || IID_ISideShowContent == riid) { *ppvObject = this; AddRef(); return S_OK; } return E_NOINTERFACE; } ULONG CHelloWorldContent::AddRef() { return ::InterlockedIncrement(&m_nRef); } ULONG CHelloWorldContent::Release() { LONG nRef = ::InterlockedDecrement(&m_nRef); if (0 == nRef) { delete this; } return nRef; } // // ISideShowContent methods // STDMETHODIMP CHelloWorldContent::GetContent( ISideShowCapabilities* /*pICapabilities*/, DWORD *pdwSize, BYTE **ppbData ) { HRESULT hr = S_OK; // // For now, just use static content to send to the device. // The string needs to be UTF-8. // char* szXML = "