/////////////////////////////////////////////////////////////////////// // MarshalIFPtr.cpp - definitions for component MarshalInterfacePtr // // // // Platform: Dell Dimension 8100, Windows 2000, SP2 // // Application: Demonstration of Marshaling Interface Pointers // // CSE775 - Distributed Objects, Spring 2004 // // Modified: Jim Fawcett, Syracuse Univ, CST 2-187 // // (315) 443-3948, fawcett@ecs.syr.edu // /////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "MarshalIFPtr.h" #include ".\marshalifptr.h" #include STDMETHODIMP CMarshalIFPtr::getString(BSTR* pBstr) { std::string msg = "hi from server"; CComBSTR temp(msg.c_str()); *pBstr = temp.Detach(); std::cout << "\n component sending: \"" << msg.c_str() << "\""; // MessageBox(NULL,(COLE2T)_bstr,"debug",MB_OK); return S_OK; } STDMETHODIMP CMarshalIFPtr::putString(BSTR bstr) { _bstr = bstr; // MessageBox(NULL,(COLE2T)_bstr,"debug",MB_OK); std::wcout << L"\n component received: " << static_cast(_bstr); return S_OK; }