// String.cpp : Implementation of CString #include "stdafx.h" #include "ATLStrings.h" #include "String.h" #include #include using namespace std; wstring prefix = L" component:\t\t"; ///////////////////////////////////////////////////////////////////////////// // CString STDMETHODIMP CString::Fx(BSTR bstr) { wcout << prefix << bstr << endl; return S_OK; } STDMETHODIMP CString::Fy(BSTR *pBstr) { wcout << prefix + L"Allocating Memory for BSTR" << endl; *pBstr = SysAllocString(OLESTR("message from component")); return S_OK; }