~ubuntu-branches/ubuntu/intrepid/gpac/intrepid-proposed

« back to all changes in this revision

Viewing changes to applications/GPAX/GPAX.cpp

  • Committer: Bazaar Package Importer
  • Author(s): John Dong
  • Date: 2007-01-24 23:34:57 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070124233457-zzlls8afkt0nyakj
Tags: 0.4.2~rc2-0ubuntu1
* New upstream release
  * Most notably MP4 tagging support via MP4Box -itags
* debian/patches/01_64bits.dpatch: dropped; included upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// GPAX.cpp : Implementation of DLL Exports.
 
2
 
 
3
 
 
4
// Note: Proxy/Stub Information
 
5
//      To build a separate proxy/stub DLL, 
 
6
//      run nmake -f GPAXps.mk in the project directory.
 
7
 
 
8
#include "stdafx.h"
 
9
#include "resource.h"
 
10
#include <initguid.h>
 
11
#include "GPAX.h"
 
12
 
 
13
#include "GPAX_i.c"
 
14
#include "GPAXPlugin.h"
 
15
 
 
16
 
 
17
CComModule _Module;
 
18
 
 
19
BEGIN_OBJECT_MAP(ObjectMap)
 
20
OBJECT_ENTRY(CLSID_GPAX, CGPAXPlugin)
 
21
END_OBJECT_MAP()
 
22
 
 
23
/////////////////////////////////////////////////////////////////////////////
 
24
// DLL Entry Point
 
25
 
 
26
extern "C"
 
27
#ifdef _WIN32_WCE
 
28
BOOL WINAPI DllMain(HANDLE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
 
29
#else
 
30
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
 
31
#endif
 
32
{
 
33
    if (dwReason == DLL_PROCESS_ATTACH)
 
34
    {
 
35
        _Module.Init(ObjectMap, (HINSTANCE) hInstance, &LIBID_GPAXLib);
 
36
        DisableThreadLibraryCalls((HINSTANCE) 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