1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 // XCallback_Impl.cpp : Implementation of DLL Exports.
21 // Note: Proxy/Stub Information
22 // To build a separate proxy/stub DLL,
23 // run nmake -f XCallback_Implps.mk in the project directory.
28 #include "XCallback_Impl.h"
30 #include "XCallback_Impl_i.c"
36 BEGIN_OBJECT_MAP(ObjectMap
)
37 OBJECT_ENTRY(CLSID_Callback
, CCallback
)
38 OBJECT_ENTRY(CLSID_Simple
, CSimple
)
43 extern "C" BOOL WINAPI
DllMain(HINSTANCE hInstance
, DWORD dwReason
, LPVOID
/*lpReserved*/)
45 if (dwReason
== DLL_PROCESS_ATTACH
)
47 _Module
.Init(ObjectMap
, hInstance
, &LIBID_XCALLBACK_IMPLLib
);
48 DisableThreadLibraryCalls(hInstance
);
50 else if (dwReason
== DLL_PROCESS_DETACH
)
55 // Used to determine whether the DLL can be unloaded by OLE
57 STDAPI
DllCanUnloadNow(void) { return (_Module
.GetLockCount() == 0) ? S_OK
: S_FALSE
; }
59 // Returns a class factory to create an object of the requested type
61 STDAPI
DllGetClassObject(REFCLSID rclsid
, REFIID riid
, LPVOID
* ppv
)
63 return _Module
.GetClassObject(rclsid
, riid
, ppv
);
66 // DllRegisterServer - Adds entries to the system registry
68 STDAPI
DllRegisterServer(void)
70 // registers object, typelib and all interfaces in typelib
71 return _Module
.RegisterServer(TRUE
);
74 // DllUnregisterServer - Removes entries from the system registry
76 STDAPI
DllUnregisterServer(void) { return _Module
.UnregisterServer(TRUE
); }
78 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */