bump product version to 6.3.0.0.beta1
[LibreOffice.git] / extensions / test / ole / AxTestComponents / AxTestComponents.cpp
bloba981e7b43eebc3b98721e9bda803f5aded8cb29e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
21 // Note: Proxy/Stub Information
22 // To build a separate proxy/stub DLL,
23 // run nmake -f AxTestComponentsps.mk in the project directory.
25 #include "stdafx.h"
26 #include "resource.h"
27 #include <initguid.h>
29 #include "Basic.h"
30 #include "Foo.h"
33 CComModule _Module;
35 BEGIN_OBJECT_MAP(ObjectMap)
36 OBJECT_ENTRY(CLSID_Basic, CBasic)
37 OBJECT_ENTRY(CLSID_Foo, CFoo)
38 END_OBJECT_MAP()
41 // DLL Entry Point
43 extern "C"
44 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
46 if (dwReason == DLL_PROCESS_ATTACH)
48 _Module.Init(ObjectMap, hInstance, &LIBID_AXTESTCOMPONENTSLib);
49 DisableThreadLibraryCalls(hInstance);
51 else if (dwReason == DLL_PROCESS_DETACH)
52 _Module.Term();
53 return TRUE; // ok
57 // Used to determine whether the DLL can be unloaded by OLE
59 STDAPI DllCanUnloadNow(void)
61 return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
65 // Returns a class factory to create an object of the requested type
67 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
69 return _Module.GetClassObject(rclsid, riid, ppv);
73 // DllRegisterServer - Adds entries to the system registry
75 STDAPI DllRegisterServer(void)
77 // registers object, typelib and all interfaces in typelib
78 return _Module.RegisterServer(TRUE);
82 // DllUnregisterServer - Removes entries from the system registry
84 STDAPI DllUnregisterServer(void)
86 return _Module.UnregisterServer(TRUE);
90 //VT_I4 size_t V_ERROR VARIANT VARIANT_FALSE CComVariant FADF_EMBEDDED
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */