///////////////////////////////////////////////////////////////////// // Strings.cpp - Implements members of ATL-based CString class // // for ATL_Inproc_Ex1 project // // // // Jim Fawcett, CSE775 - Distributed Objects, Spring 2007 // ///////////////////////////////////////////////////////////////////// /* * NOTE: * - Do not include this file in client's project * - Instead, include ATL_Inproc_Ex1_i.c, which provides GUID * definitions */ #include "stdafx.h" #include "Strings.h" #include // CStrings STDMETHODIMP CStrings::PutString(BSTR sendStr) { std::wcout << L"\n Server received:\t" << sendStr; return S_OK; } STDMETHODIMP CStrings::GetString(BSTR* retrieveString) { /////////////////////////////////////////////////////////////////// // The statement below works for C++ client but not for C# client // *retrieveString = L"\n Server sending:\tserver reply"; CComBSTR str(L"\n Server sending:\tthis is a rather long and boring server reply"); *retrieveString = str.Detach(); return S_OK; }