Back to index

lightning-sunbird  0.9+nobinonly
activexml.cpp
Go to the documentation of this file.
00001 // activexml.cpp : Implementation of DLL Exports.
00002 
00003 
00004 // Note: Proxy/Stub Information
00005 //      To build a separate proxy/stub DLL, 
00006 //      run nmake -f activexmlps.mk in the project directory.
00007 
00008 #include "stdafx.h"
00009 #include "resource.h"
00010 //#include <initguid.h>
00011 //#include "activexml.h"
00012 
00013 #include "activexml_i.c"
00014 #include "XMLDocument.h"
00015 #include "XMLElement.h"
00016 #include "XMLElementCollection.h"
00017 
00018 
00019 CComModule _Module;
00020 
00021 BEGIN_OBJECT_MAP(ObjectMap)
00022 OBJECT_ENTRY(CLSID_MozXMLDocument, CXMLDocument)
00023 //OBJECT_ENTRY(CLSID_MozXMLElement, CXMLElement)
00024 //OBJECT_ENTRY(CLSID_MozXMLElementCollection, CXMLElementCollection)
00025 END_OBJECT_MAP()
00026 
00028 // DLL Entry Point
00029 
00030 extern "C"
00031 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
00032 {
00033     if (dwReason == DLL_PROCESS_ATTACH)
00034     {
00035         _Module.Init(ObjectMap, hInstance, &LIBID_MozActiveXMLLib);
00036         DisableThreadLibraryCalls(hInstance);
00037     }
00038     else if (dwReason == DLL_PROCESS_DETACH)
00039         _Module.Term();
00040     return TRUE;    // ok
00041 }
00042 
00044 // Used to determine whether the DLL can be unloaded by OLE
00045 
00046 STDAPI DllCanUnloadNow(void)
00047 {
00048     return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
00049 }
00050 
00052 // Returns a class factory to create an object of the requested type
00053 
00054 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00055 {
00056     return _Module.GetClassObject(rclsid, riid, ppv);
00057 }
00058 
00060 // DllRegisterServer - Adds entries to the system registry
00061 
00062 STDAPI DllRegisterServer(void)
00063 {
00064     // registers object, typelib and all interfaces in typelib
00065     return _Module.RegisterServer(TRUE);
00066 }
00067 
00069 // DllUnregisterServer - Removes entries from the system registry
00070 
00071 STDAPI DllUnregisterServer(void)
00072 {
00073     return _Module.UnregisterServer(TRUE);
00074 }
00075 
00076