PageRenderTime 2ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Visual Studio 2008/CppCOMClient/CppCOMClient.cpp

#
C++ | 42 lines | 16 code | 8 blank | 18 comment | 0 complexity | 27781e53de3951d731b7fa6e406b0504 MD5 | raw file
 1/****************************** Module Header ******************************\
 2* Module Name:  CppCOMClient.cpp
 3* Project:      CppCOMClient
 4* Copyright (c) Microsoft Corporation.
 5* 
 6* The C++ code sample demonstrates using the raw COM APIs and using the C++ 
 7* #import directive to automate the COM server ATLDllCOMServer.
 8* 
 9* This source is subject to the Microsoft Public License.
10* See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
11* All other rights reserved.
12* 
13* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, 
14* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED 
15* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
16\***************************************************************************/
17
18#pragma region Includes
19#include <stdio.h>
20
21#include "RawAPI.h"				// The examples of using the raw COM API to  
22								// consume a COM server
23#include "ImportDirective.h"	// The examples of using the #import directive 
24								// and smart pointers to consume a COM server
25#pragma endregion
26
27
28int wmain(int argc, wchar_t *argv[])
29{
30	HANDLE hThread;
31
32	hThread = CreateThread(NULL, 0, RawConsumeSTAComponent, NULL, 0, NULL);
33	WaitForSingleObject(hThread, INFINITE);
34	CloseHandle(hThread);
35
36	hThread = CreateThread(NULL, 0, ImportCSharpComponent, NULL, 0, NULL);
37	WaitForSingleObject(hThread, INFINITE);	
38	CloseHandle(hThread);
39
40	return 0;
41}
42