📄 exchangeclientdll.cpp
字号:
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
//
#include "Includes.h"
#include "initguid.h"
#include "ExchangeClient.h"
#include "DebugMsg.h"
#include "block_allocator.hxx"
#include "Settings.h"
#include "..\contacts\ContactsFormatHandler.h"
#include "..\galsearch\GALSearchFormatHandler.h"
#include "..\freebusy\FreeBusyFormatHandler.h"
#include "DataRecord.h"
//Contains Dll exports
CComModule _Module;
BEGIN_OBJECT_MAP(ObjectMap)
OBJECT_ENTRY(CLSID_ExchangeClient, CExchangeClient)
END_OBJECT_MAP()
DECLARE_DEBUG_CUR_SETTINGS();
UINT CFreeBusyFormatHandler::sm_SearchLength = 0;
/////////////////////////////////////////////////////////////////////////////
// DLL Entry Point
extern "C"
BOOL WINAPI DllMain(HANDLE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
//Register to get debugging info
DEBUGREGISTER((HINSTANCE)hInstance);
_Module.Init(ObjectMap, (HINSTANCE)hInstance);
//Initialize the settings from the registry and the parse tables from
//the subsequent values
(VOID)OWAClientSetting::Initialize();
(VOID)CContactsFormatHandler::BuildParseTable();
(VOID)CFreeBusyFormatHandler::BuildParseTable();
(VOID)CGALSearchFormatHandler::BuildParseTable();
#ifndef UNDER_CE
DisableThreadLibraryCalls((HINSTANCE)hInstance);
#endif
}
else if (dwReason == DLL_PROCESS_DETACH)
{
_Module.Term();
MemTrackCheck();
}
return TRUE; // ok
}
/////////////////////////////////////////////////////////////////////////////
// Used to determine whether the DLL can be unloaded by OLE
STDAPI DllCanUnloadNow(void)
{
return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
}
/////////////////////////////////////////////////////////////////////////////
// Returns a class factory to create an object of the requested type
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
{
return _Module.GetClassObject(rclsid, riid, ppv);
}
/////////////////////////////////////////////////////////////////////////////
// DllRegisterServer - Adds entries to the system registry
STDAPI DllRegisterServer(void)
{
// registers object, typelib and all interfaces in typelib
return _Module.RegisterServer(TRUE);
}
/////////////////////////////////////////////////////////////////////////////
// DllUnregisterServer - Removes entries from the system registry
STDAPI DllUnregisterServer(void)
{
_Module.UnregisterServer();
return S_OK;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -