mirror of https://github.com/tongzx/nt5src
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
835 B
45 lines
835 B
// Copyright (c) Microsoft. All rights reserved.
|
|
//
|
|
// This is unpublished source code of Microsoft.
|
|
// The copyright notice above does not evidence any
|
|
// actual or intended publication of such source code.
|
|
|
|
// OneLiner : Implementation of MUsingCom
|
|
// DevUnit : wlbstest
|
|
// Author : Murtaza Hakim
|
|
|
|
|
|
// include files
|
|
|
|
#include "MUsingCom.h"
|
|
|
|
#include <iostream>
|
|
|
|
using namespace std;
|
|
|
|
MUsingCom::MUsingCom( DWORD type )
|
|
: status( MUsingCom_SUCCESS )
|
|
{
|
|
HRESULT hr;
|
|
|
|
// Initialize com.
|
|
hr = CoInitializeEx(0, type );
|
|
if ( FAILED(hr) )
|
|
{
|
|
cout << "Failed to initialize COM library" << hr << endl;
|
|
status = COM_FAILURE;
|
|
}
|
|
}
|
|
|
|
// destructor
|
|
MUsingCom::~MUsingCom()
|
|
{
|
|
CoUninitialize();
|
|
}
|
|
|
|
// getStatus
|
|
MUsingCom::MUsingCom_Error
|
|
MUsingCom::getStatus()
|
|
{
|
|
return status;
|
|
}
|