home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 November / Chip_2002-11_cd1.bin / zkuste / vbasic / Data / Utils / WME71SDK.exe / RCDATA / CABINET / encview.cpp < prev    next >
C/C++ Source or Header  |  2001-03-02  |  2KB  |  75 lines

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