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.
22 // Note: Proxy/Stub Information
23 // To build a separate proxy/stub DLL,
24 // run nmake -f XCallback_Implps.mk in the project directory.
29 #include "XCallback_Impl.h"
31 #include "XCallback_Impl_i.c"
38 BEGIN_OBJECT_MAP(ObjectMap
)
39 OBJECT_ENTRY(CLSID_Callback
, CCallback
)
40 OBJECT_ENTRY(CLSID_Simple
, CSimple
)
47 BOOL WINAPI
DllMain(HINSTANCE hInstance
, DWORD dwReason
, LPVOID
/*lpReserved*/)
49 if (dwReason
== DLL_PROCESS_ATTACH
)
51 _Module
.Init(ObjectMap
, hInstance
, &LIBID_XCALLBACK_IMPLLib
);
52 DisableThreadLibraryCalls(hInstance
);
54 else if (dwReason
== DLL_PROCESS_DETACH
)
60 // Used to determine whether the DLL can be unloaded by OLE
62 STDAPI
DllCanUnloadNow(void)
64 return (_Module
.GetLockCount()==0) ? S_OK
: S_FALSE
;
68 // Returns a class factory to create an object of the requested type
70 STDAPI
DllGetClassObject(REFCLSID rclsid
, REFIID riid
, LPVOID
* ppv
)
72 return _Module
.GetClassObject(rclsid
, riid
, ppv
);
76 // DllRegisterServer - Adds entries to the system registry
78 STDAPI
DllRegisterServer(void)
80 // registers object, typelib and all interfaces in typelib
81 return _Module
.RegisterServer(TRUE
);
85 // DllUnregisterServer - Removes entries from the system registry
87 STDAPI
DllUnregisterServer(void)
89 return _Module
.UnregisterServer(TRUE
);
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */