~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/embedding/browser/activex/src/xml/activexml.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// activexml.cpp : Implementation of DLL Exports.
 
2
 
 
3
 
 
4
// Note: Proxy/Stub Information
 
5
//      To build a separate proxy/stub DLL, 
 
6
//      run nmake -f activexmlps.mk in the project directory.
 
7
 
 
8
#include "stdafx.h"
 
9
#include "resource.h"
 
10
//#include <initguid.h>
 
11
//#include "activexml.h"
 
12
 
 
13
#include "activexml_i.c"
 
14
#include "XMLDocument.h"
 
15
#include "XMLElement.h"
 
16
#include "XMLElementCollection.h"
 
17
 
 
18
 
 
19
CComModule _Module;
 
20
 
 
21
BEGIN_OBJECT_MAP(ObjectMap)
 
22
OBJECT_ENTRY(CLSID_MozXMLDocument, CXMLDocument)
 
23
//OBJECT_ENTRY(CLSID_MozXMLElement, CXMLElement)
 
24
//OBJECT_ENTRY(CLSID_MozXMLElementCollection, CXMLElementCollection)
 
25
END_OBJECT_MAP()
 
26
 
 
27
/////////////////////////////////////////////////////////////////////////////
 
28
// DLL Entry Point
 
29
 
 
30
extern "C"
 
31
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
 
32
{
 
33
    if (dwReason == DLL_PROCESS_ATTACH)
 
34
    {
 
35
        _Module.Init(ObjectMap, hInstance, &LIBID_MozActiveXMLLib);
 
36
        DisableThreadLibraryCalls(hInstance);
 
37
    }
 
38
    else if (dwReason == DLL_PROCESS_DETACH)
 
39
        _Module.Term();
 
40
    return TRUE;    // ok
 
41
}
 
42
 
 
43
/////////////////////////////////////////////////////////////////////////////
 
44
// Used to determine whether the DLL can be unloaded by OLE
 
45
 
 
46
STDAPI DllCanUnloadNow(void)
 
47
{
 
48
    return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
 
49
}
 
50
 
 
51
/////////////////////////////////////////////////////////////////////////////
 
52
// Returns a class factory to create an object of the requested type
 
53
 
 
54
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
 
55
{
 
56
    return _Module.GetClassObject(rclsid, riid, ppv);
 
57
}
 
58
 
 
59
/////////////////////////////////////////////////////////////////////////////
 
60
// DllRegisterServer - Adds entries to the system registry
 
61
 
 
62
STDAPI DllRegisterServer(void)
 
63
{
 
64
    // registers object, typelib and all interfaces in typelib
 
65
    return _Module.RegisterServer(TRUE);
 
66
}
 
67
 
 
68
/////////////////////////////////////////////////////////////////////////////
 
69
// DllUnregisterServer - Removes entries from the system registry
 
70
 
 
71
STDAPI DllUnregisterServer(void)
 
72
{
 
73
    return _Module.UnregisterServer(TRUE);
 
74
}
 
75
 
 
76