source: trunk/Utilities/Miscellaneous/CustomMarshal/Client/Client.cpp @ 218

Last change on this file since 218 was 218, checked in by roman, 11 years ago
File size: 1.0 KB
Line 
1////////////////////////////////////////////////////////////
2// Copyright (C) Roman Ryltsov, 2008-2013
3// Created by Roman Ryltsov roman@alax.info
4
5#include "stdafx.h"
6#include "..\Server\Server_i.h"
7#include "..\Server\Server_i.c"
8
9int _tmain(int argc, _TCHAR* argv[])
10{
11        CSingleThreadedApartment SingleThreadedApartment;
12        CComPtr<IFoo> pFooA;
13        __C(pFooA.CoCreateInstance(CLSID_Foo));
14        __C(pFooA->put_Value(CComVariant(_T("Test"))));
15        _Z4(atlTraceGeneral, 4, _T("Before CoMarshalInterThreadInterfaceInStream\n"));
16        CComPtr<IStream> pStream;
17        __C(CoMarshalInterThreadInterfaceInStream(__uuidof(IFoo), pFooA, &pStream));
18        _Z4(atlTraceGeneral, 4, _T("After CoMarshalInterThreadInterfaceInStream\n"));
19        _Z4(atlTraceGeneral, 4, _T("Before CoGetInterfaceAndReleaseStream\n"));
20        CComPtr<IFoo> pFooB;
21        __C(CoGetInterfaceAndReleaseStream(pStream, __uuidof(IFoo), (VOID**) &pFooB));
22        _Z4(atlTraceGeneral, 4, _T("After CoGetInterfaceAndReleaseStream\n"));
23        CComVariantArray vValue;
24        __C(pFooB->get_Value(&vValue));
25        return 0;
26}
27
Note: See TracBrowser for help on using the repository browser.